Class: YAML::Store
Instance Method Summary collapse
- #dump(table) ⇒ Object
-
#initialize(*o) ⇒ Store
constructor
A new instance of Store.
- #load(content) ⇒ Object
- #load_file(file) ⇒ Object
Constructor Details
#initialize(*o) ⇒ Store
Returns a new instance of Store.
8 9 10 11 12 13 14 15 16 |
# File 'lib/yaml/store.rb', line 8 def initialize( *o ) @opt = YAML::DEFAULTS.dup if String === o.first super(o.shift) end if o.last.is_a? Hash @opt.update(o.pop) end end |
Instance Method Details
#dump(table) ⇒ Object
18 19 20 |
# File 'lib/yaml/store.rb', line 18 def dump(table) @table.to_yaml(@opt) end |
#load(content) ⇒ Object
22 23 24 |
# File 'lib/yaml/store.rb', line 22 def load(content) YAML::load(content) end |
#load_file(file) ⇒ Object
26 27 28 |
# File 'lib/yaml/store.rb', line 26 def load_file(file) YAML::load(file) end |