Class: Figroll::Storage
- Inherits:
-
Object
- Object
- Figroll::Storage
- Defined in:
- lib/figroll/storage.rb
Instance Attribute Summary collapse
-
#vars ⇒ Object
readonly
Returns the value of attribute vars.
Instance Method Summary collapse
- #fetch(key) ⇒ Object
- #import(incoming) ⇒ Object
-
#initialize ⇒ Storage
constructor
A new instance of Storage.
- #keys ⇒ Object
Constructor Details
#initialize ⇒ Storage
Returns a new instance of Storage.
5 6 7 |
# File 'lib/figroll/storage.rb', line 5 def initialize reset end |
Instance Attribute Details
#vars ⇒ Object (readonly)
Returns the value of attribute vars.
3 4 5 |
# File 'lib/figroll/storage.rb', line 3 def vars @vars end |
Instance Method Details
#fetch(key) ⇒ Object
9 10 11 |
# File 'lib/figroll/storage.rb', line 9 def fetch(key) @vars.fetch(Figroll.normalize(key)) end |
#import(incoming) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/figroll/storage.rb', line 13 def import(incoming) incoming.keys.each do |key| vars[Figroll.normalize(key)] = incoming[key] end nil end |
#keys ⇒ Object
21 22 23 |
# File 'lib/figroll/storage.rb', line 21 def keys vars.keys end |