Class: Trunk::YAMLStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/trunk/yaml_storage.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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_keyObject (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