Class: SmartCollection::Config
- Inherits:
-
Object
- Object
- SmartCollection::Config
- Defined in:
- lib/smart_collection/config.rb
Instance Attribute Summary collapse
-
#cache_manager ⇒ Object
Returns the value of attribute cache_manager.
-
#raw_config ⇒ Object
readonly
Returns the value of attribute raw_config.
Instance Method Summary collapse
- #cache_config ⇒ Object
-
#initialize(raw_config) ⇒ Config
constructor
A new instance of Config.
- #item_class ⇒ Object
- #item_class_name ⇒ Object
- #item_name ⇒ Object
- #items_name ⇒ Object
Constructor Details
#initialize(raw_config) ⇒ Config
Returns a new instance of Config.
6 7 8 |
# File 'lib/smart_collection/config.rb', line 6 def initialize raw_config @raw_config = raw_config end |
Instance Attribute Details
#cache_manager ⇒ Object
Returns the value of attribute cache_manager.
3 4 5 |
# File 'lib/smart_collection/config.rb', line 3 def cache_manager @cache_manager end |
#raw_config ⇒ Object (readonly)
Returns the value of attribute raw_config.
4 5 6 |
# File 'lib/smart_collection/config.rb', line 4 def raw_config @raw_config end |
Instance Method Details
#cache_config ⇒ Object
26 27 28 |
# File 'lib/smart_collection/config.rb', line 26 def cache_config @raw_config[:cached_by] end |
#item_class ⇒ Object
22 23 24 |
# File 'lib/smart_collection/config.rb', line 22 def item_class @item_class ||= item_class_name.constantize end |
#item_class_name ⇒ Object
18 19 20 |
# File 'lib/smart_collection/config.rb', line 18 def item_class_name @raw_config[:class_name] end |
#item_name ⇒ Object
14 15 16 |
# File 'lib/smart_collection/config.rb', line 14 def item_name items_name.to_s.singularize.to_sym end |
#items_name ⇒ Object
10 11 12 |
# File 'lib/smart_collection/config.rb', line 10 def items_name @raw_config[:items] end |