Class: Trax::Model::CacheKey

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/trax/model/cache_key.rb

Constant Summary collapse

CACHE_OPTION_KEYS =
[ :expires_in ].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, **params) ⇒ CacheKey

Returns a new instance of CacheKey.



8
9
10
11
12
13
# File 'lib/trax/model/cache_key.rb', line 8

def initialize(*args, **params)
  params.symbolize_keys!
  @options = params.extract!(*CACHE_OPTION_KEYS)
  @search_params = params
  @obj = ::Set[*args.sort, params.sort].flatten.to_a
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/trax/model/cache_key.rb', line 6

def options
  @options
end

#search_paramsObject (readonly)

Returns the value of attribute search_params.



6
7
8
# File 'lib/trax/model/cache_key.rb', line 6

def search_params
  @search_params
end

Instance Method Details

#__getobj__Object



15
16
17
# File 'lib/trax/model/cache_key.rb', line 15

def __getobj__
  @obj
end