Class: Hash

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

Overview

WithIndifferentAccess

Instance Method Summary collapse

Instance Method Details

#from_orientObject



159
160
161
162
163
164
# File 'lib/other.rb', line 159

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



173
174
175
# File 'lib/other.rb', line 173

def nested_under_indifferent_access
  HashWithIndifferentAccess.new self
end

#to_orientObject



166
167
168
169
170
171
# File 'lib/other.rb', line 166

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