Methods
restore_snapshot stringify_keys stringify_keys! symbolize_keys symbolize_keys! take_snapshot to_openobject to_xml
Included Modules
Public Instance methods
restore_snapshot(snap)
# File lib/more/facets/snapshot.rb, line 195
  def restore_snapshot(snap) replace(snap) end
stringify_keys(&filter)

Converts all keys in the Hash to Strings, returning a new Hash. With a filter parameter, limits conversion to only a certain selection of keys.

  foo = { :name=>'Gavin', :wife=>:Lisa }
  foo.stringify_keys    #=>  { "name"=>"Gavin", "wife"=>:Lisa }
  foo.inspect           #=>  { :name =>"Gavin", :wife=>:Lisa }

This method is considered archaic. Use rekey instead.

# File lib/more/facets/hash/symbolize_keys.rb, line 59
  def stringify_keys(&filter)
    if filter
      rekey{ |k| filter[k] ? k.to_s : nil }
    else
      rekey{ |k| k.to_s }
    end
  end
stringify_keys!(&filter)

Synonym for Hash#stringify_keys, but modifies the receiver in place and returns it. With a filter parameter, limits conversion to only a certain selection of keys.

  foo = { :name=>'Gavin', :wife=>:Lisa }
  foo.stringify_keys!    #=>  { "name"=>"Gavin", "wife"=>:Lisa }
  foo.inspect            #=>  { "name"=>"Gavin", "wife"=>:Lisa }

This method is considered archaic. Use rekey instead.

# File lib/more/facets/hash/symbolize_keys.rb, line 78
  def stringify_keys!(&filter)
    if filter
      rekey!{ |k| filter[k] ? k.to_s : nil }
    else
      rekey!{ |k| k.to_s }
    end
  end
symbolize_keys(&filter)

Converts all keys in the Hash to Symbols, returning a new Hash. With a filter, limits conversion to only a certain selection of keys.

  foo = { :name=>'Gavin', 'wife'=>:Lisa }
  foo.symbolize_keys    #=>  { :name=>"Gavin", :wife=>:Lisa }
  foo.inspect           #=>  { "name" =>"Gavin", "wife"=>:Lisa }

This method is considered archaic. Use rekey instead.

# File lib/more/facets/hash/symbolize_keys.rb, line 14
  def symbolize_keys(&filter)
    if filter
      rekey{ |k| filter[k] ? k.to_sym : nil }
    else
      rekey{ |k| k.to_sym }
    end
  end
symbolize_keys!(&filter)

Synonym for Hash#symbolize_keys, but modifies the receiver in place and returns it. With a filter parameter, limits conversion to only a certain selection of keys.

  foo = { 'name'=>'Gavin', 'wife'=>:Lisa }
  foo.symbolize_keys!    #=>  { :name=>"Gavin", :wife=>:Lisa }
  foo.inspect            #=>  { :name=>"Gavin", :wife=>:Lisa }

This method is considered archaic. Use rekey instead.

# File lib/more/facets/hash/symbolize_keys.rb, line 39
  def symbolize_keys!(&filter)
    if filter
      rekey!{ |k| filter[k] ? k.to_sym : nil }
    else
      rekey!{ |k| k.to_sym }
    end

  end
take_snapshot()
# File lib/more/facets/snapshot.rb, line 194
  def take_snapshot() dup end
to_openobject()

Convert a Hash into an OpenObject.

# File lib/more/facets/openobject.rb, line 241
  def to_openobject
    OpenObject[self]
  end
to_xml(root='root')
# File lib/more/facets/xmlhash.rb, line 67
  def to_xml(root='root')
    Blow::Hash2Xml.convert(root, self)
  end