Class: Robut::Storage::YamlStore

Inherits:
Base
  • Object
show all
Defined in:
lib/robut/storage/yaml_store.rb

Overview

A store backed by a persistent on-disk yaml file.

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.fileObject

The path to the file this store will persist to.



9
10
11
# File 'lib/robut/storage/yaml_store.rb', line 9

def file
  @file
end

Class Method Details

.[](k) ⇒ Object

Returns the value at the key k.



27
28
29
# File 'lib/robut/storage/yaml_store.rb', line 27

def [](k)
  internal[k]
end

.[]=(k, v) ⇒ Object

Sets the key k to the value v



20
21
22
23
24
# File 'lib/robut/storage/yaml_store.rb', line 20

def []=(k, v)
  internal[k] = v
  persist!
  v
end