Sha256: fee597838e07f08b7ea10d2f162477bcf0b4d77709c199d50ab4c66e6d12ca6f

Contents?: true

Size: 521 Bytes

Versions: 27

Compression:

Stored size: 521 Bytes

Contents

# Extensions for the Hash.
#
class Hash # :nodoc:all

  # Dumps jsonized self to the path given. Minus extension.
  #
  def dump_json path
    File.open(path, 'w') do |out_file|
      Yajl::Encoder.encode self, out_file
    end
  end

  # Dumps binary self to the path given. Minus extension.
  #
  def dump_marshal path
    File.open(path, 'w:binary') do |out_file|
      Marshal.dump self, out_file
    end
  end

  # Use yajl's encoding.
  #
  def to_json options = {}
    Yajl::Encoder.encode self, options
  end

end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
picky-3.5.1 lib/picky/extensions/hash.rb
picky-3.5.0 lib/picky/extensions/hash.rb
picky-3.4.3 lib/picky/extensions/hash.rb
picky-3.4.2 lib/picky/extensions/hash.rb
picky-3.4.1 lib/picky/extensions/hash.rb
picky-3.4.0 lib/picky/extensions/hash.rb
picky-3.3.3 lib/picky/extensions/hash.rb
picky-3.3.2 lib/picky/extensions/hash.rb
picky-3.3.1 lib/picky/extensions/hash.rb
picky-3.3.0 lib/picky/extensions/hash.rb
picky-3.2.0 lib/picky/extensions/hash.rb
picky-3.1.13 lib/picky/extensions/hash.rb
picky-3.1.12 lib/picky/extensions/hash.rb
picky-3.1.11 lib/picky/extensions/hash.rb
picky-3.1.10 lib/picky/extensions/hash.rb
picky-3.1.9 lib/picky/extensions/hash.rb
picky-3.1.8 lib/picky/extensions/hash.rb
picky-3.1.7 lib/picky/extensions/hash.rb
picky-3.1.6 lib/picky/extensions/hash.rb
picky-3.1.5 lib/picky/extensions/hash.rb