Class: Figroll::Storage

Inherits:
Object
  • Object
show all
Defined in:
lib/figroll/storage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStorage

Returns a new instance of Storage.



5
6
7
# File 'lib/figroll/storage.rb', line 5

def initialize
  reset
end

Instance Attribute Details

#varsObject (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

#keysObject



21
22
23
# File 'lib/figroll/storage.rb', line 21

def keys
  vars.keys
end