Sha256: c1e6b422df8f27027f2bec5ace7d1736d45bce01433194a0658a47385f0b695a

Contents?: true

Size: 405 Bytes

Versions: 7

Compression:

Stored size: 405 Bytes

Contents

#
# YAML::Store
#
require 'yaml'
require 'pstore'

class YAML::Store < PStore
  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

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

  def load(content)
    YAML::load(content)
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mkrf-0.2.1 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb
mkrf-0.2.2 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb
mkrf-0.1.0 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb
mkrf-0.1.1 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb
mkrf-0.1.2 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb
mkrf-0.2.0 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb
mkrf-0.2.3 test/sample_files/syck-0.55/ext/ruby/lib/yaml/store.rb