Class: Trax::Model::CacheKey
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Trax::Model::CacheKey
- Defined in:
- lib/trax/model/cache_key.rb
Constant Summary collapse
- CACHE_OPTION_KEYS =
[ :expires_in ].freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#search_params ⇒ Object
readonly
Returns the value of attribute search_params.
Instance Method Summary collapse
- #__getobj__ ⇒ Object
-
#initialize(*args, **params) ⇒ CacheKey
constructor
A new instance of CacheKey.
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
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/trax/model/cache_key.rb', line 6 def @options end |
#search_params ⇒ Object (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 |