Class: Tailmix::Runtime::AttributeCache
- Inherits:
-
Object
- Object
- Tailmix::Runtime::AttributeCache
- Defined in:
- lib/tailmix/runtime/attribute_cache.rb
Instance Method Summary collapse
- #clear! ⇒ Object
- #get(element_name) ⇒ Object
-
#initialize ⇒ AttributeCache
constructor
A new instance of AttributeCache.
- #set(element_name, attributes) ⇒ Object
Constructor Details
#initialize ⇒ AttributeCache
Returns a new instance of AttributeCache.
6 7 8 |
# File 'lib/tailmix/runtime/attribute_cache.rb', line 6 def initialize @cache = {} end |
Instance Method Details
#clear! ⇒ Object
18 19 20 |
# File 'lib/tailmix/runtime/attribute_cache.rb', line 18 def clear! @cache.clear end |
#get(element_name) ⇒ Object
10 11 12 |
# File 'lib/tailmix/runtime/attribute_cache.rb', line 10 def get(element_name) @cache[element_name.to_sym] end |
#set(element_name, attributes) ⇒ Object
14 15 16 |
# File 'lib/tailmix/runtime/attribute_cache.rb', line 14 def set(element_name, attributes) @cache[element_name.to_sym] = attributes end |