Sha256: bfe388917ce5fdd3b8787c9b9bc2b5f44286d59fcfdd31f3d4f4ed6677b85106

Contents?: true

Size: 532 Bytes

Versions: 52

Compression:

Stored size: 532 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_marshalled 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

52 entries across 52 versions & 1 rubygems

Version Path
picky-1.2.2 lib/picky/extensions/hash.rb
picky-1.2.1 lib/picky/extensions/hash.rb
picky-1.2.0 lib/picky/extensions/hash.rb
picky-1.1.7 lib/picky/extensions/hash.rb
picky-1.1.6 lib/picky/extensions/hash.rb
picky-1.1.5 lib/picky/extensions/hash.rb
picky-1.1.4 lib/picky/extensions/hash.rb
picky-1.1.3 lib/picky/extensions/hash.rb
picky-1.1.2 lib/picky/extensions/hash.rb
picky-1.1.1 lib/picky/extensions/hash.rb
picky-1.1.0 lib/picky/extensions/hash.rb
picky-1.0.0 lib/picky/extensions/hash.rb