Class: Jacky::Settings::StoreWrapper
- Inherits:
-
Object
- Object
- Jacky::Settings::StoreWrapper
- Defined in:
- lib/jacky/settings.rb
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(store) ⇒ StoreWrapper
constructor
A new instance of StoreWrapper.
- #method_missing(m, *args, &block) ⇒ Object
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
#store ⇒ Object (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 |