Class: JvYAML::Store

Inherits:
PStore
  • Object
show all
Defined in:
lib/jvyaml/store.rb

Instance Method Summary collapse

Constructor Details

#initialize(*o) ⇒ Store

Returns a new instance of Store.



8
9
10
11
12
13
14
15
16
# File 'lib/jvyaml/store.rb', line 8

def initialize( *o )
  @opt = JvYAML::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/jvyaml/store.rb', line 18

def dump(table)
  @table.to_jvyaml(@opt)
end

#load(content) ⇒ Object



22
23
24
# File 'lib/jvyaml/store.rb', line 22

def load(content)
  JvYAML::load(content)
end

#load_file(file) ⇒ Object



26
27
28
# File 'lib/jvyaml/store.rb', line 26

def load_file(file)
  JvYAML::load(file)
end