Class: Trunk::YAMLStorage
- Inherits:
-
Object
- Object
- Trunk::YAMLStorage
- Defined in:
- lib/trunk/yaml_storage.rb
Instance Attribute Summary collapse
-
#absolute_path ⇒ Object
readonly
Returns the value of attribute absolute_path.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
Instance Method Summary collapse
- #fetch(*args) ⇒ Object
-
#initialize(absolute_path, private_key) ⇒ YAMLStorage
constructor
A new instance of YAMLStorage.
- #store(*args) ⇒ Object
Constructor Details
#initialize(absolute_path, private_key) ⇒ YAMLStorage
Returns a new instance of YAMLStorage.
5 6 7 8 |
# File 'lib/trunk/yaml_storage.rb', line 5 def initialize(absolute_path, private_key) @absolute_path = absolute_path @private_key = private_key end |
Instance Attribute Details
#absolute_path ⇒ Object (readonly)
Returns the value of attribute absolute_path.
3 4 5 |
# File 'lib/trunk/yaml_storage.rb', line 3 def absolute_path @absolute_path end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
3 4 5 |
# File 'lib/trunk/yaml_storage.rb', line 3 def private_key @private_key end |
Instance Method Details
#fetch(*args) ⇒ Object
10 11 12 13 14 |
# File 'lib/trunk/yaml_storage.rb', line 10 def fetch(*args) transaction do |storage| storage.fetch(*args) end end |
#store(*args) ⇒ Object
16 17 18 19 20 |
# File 'lib/trunk/yaml_storage.rb', line 16 def store(*args) transaction do |storage| storage.store(*args) end end |