You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: redis_caching.rb
    path of file: ./repos/vets-api/app/models/concerns
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module RedisCaching
  extend ActiveSupport::Concern
    
    def set_cached(key, data)
      if data
        @redis.set(key, data.to_json)
        @redis.expire(key, @redis_ttl)
      else
        Rails.logger.info('Attempted to set nil data in redis cache')
      end