source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/yaml/store.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 405 bytes
Line 
1#
2# YAML::Store
3#
4require 'yaml'
5require 'pstore'
6
7class YAML::Store < PStore
8 def initialize( *o )
9 @opt = YAML::DEFAULTS.dup
10 if String === o.first
11 super(o.shift)
12 end
13 if o.last.is_a? Hash
14 @opt.update(o.pop)
15 end
16 end
17
18 def dump(table)
19 @table.to_yaml(@opt)
20 end
21
22 def load(content)
23 YAML::load(content)
24 end
25
26 def load_file(file)
27 YAML::load(file)
28 end
29end
Note: See TracBrowser for help on using the repository browser.