Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/other.rb

Overview

WithIndifferentAccess

Instance Method Summary collapse

Instance Method Details

#from_orientObject



123
124
125
126
127
128
# File 'lib/other.rb', line 123

def from_orient
  substitute_hash = HashWithIndifferentAccess.new
  #keys.each{|k| puts self[k].inspect}
  keys.each{|k| substitute_hash[k] = self[k].from_orient}
  substitute_hash
end

#nested_under_indifferent_accessObject



137
138
139
# File 'lib/other.rb', line 137

def nested_under_indifferent_access
  HashWithIndifferentAccess.new self
end

#to_orientObject



130
131
132
133
134
135
# File 'lib/other.rb', line 130

def to_orient
  #puts "here hash"
  substitute_hash = Hash.new
  keys.each{|k| substitute_hash[k] = self[k].to_orient}
  substitute_hash
end