Class: Hash

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

Instance Method Summary collapse

Instance Method Details

#delete_at(loc) ⇒ Object



27
28
29
# File 'lib/jsontools/jsontools.rb', line 27

def delete_at loc
  self.delete loc
end

#insert(loc, val) ⇒ Object



23
24
25
# File 'lib/jsontools/jsontools.rb', line 23

def insert loc,val
  self[loc] = val
end

#json_deep_copyObject

A fairly inefficient means of generating a deep copy of the hash; but it ensures that our hash conforms to the JSON spec and does not contain any cycles



19
20
21
# File 'lib/jsontools/jsontools.rb', line 19

def json_deep_copy
  JSON.parse to_json
end