Class: Jacky::Settings::StoreWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/jacky/settings.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(store) ⇒ StoreWrapper

Returns a new instance of StoreWrapper.



17
18
19
# File 'lib/jacky/settings.rb', line 17

def initialize(store)
  @store = store
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



21
22
23
# File 'lib/jacky/settings.rb', line 21

def method_missing(m, *args, &block)
  self[m]
end

Instance Attribute Details

#storeObject (readonly)

Returns the value of attribute store.



15
16
17
# File 'lib/jacky/settings.rb', line 15

def store
  @store
end

Instance Method Details

#[](key) ⇒ Object



25
26
27
# File 'lib/jacky/settings.rb', line 25

def [](key)
  @store.transaction{@store[key]}
end