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-3.0.0.pre5 lib/picky/extensions/hash.rb
picky-3.0.0.pre4 lib/picky/extensions/hash.rb
picky-3.0.0.pre3 lib/picky/extensions/hash.rb
picky-3.0.0.pre2 lib/picky/extensions/hash.rb
picky-3.0.0.pre1 lib/picky/extensions/hash.rb
picky-2.7.0 lib/picky/extensions/hash.rb
picky-2.6.0 lib/picky/extensions/hash.rb
picky-2.5.2 lib/picky/internals/extensions/hash.rb
picky-2.5.1 lib/picky/internals/extensions/hash.rb
picky-2.5.0 lib/picky/internals/extensions/hash.rb
picky-2.4.3 lib/picky/internals/extensions/hash.rb
picky-2.4.2 lib/picky/internals/extensions/hash.rb
picky-2.4.1 lib/picky/internals/extensions/hash.rb
picky-2.4.0 lib/picky/internals/extensions/hash.rb
picky-2.3.0 lib/picky/internals/extensions/hash.rb
picky-2.2.1 lib/picky/internals/extensions/hash.rb
picky-2.2.0 lib/picky/internals/extensions/hash.rb
picky-2.1.2 lib/picky/internals/extensions/hash.rb
picky-2.1.1 lib/picky/internals/extensions/hash.rb
picky-2.1.0 lib/picky/internals/extensions/hash.rb