Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/jsontools/jsontools.rb
Instance Method Summary collapse
- #delete_at(loc) ⇒ Object
- #insert(loc, val) ⇒ Object
-
#json_deep_copy ⇒ Object
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.
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_copy ⇒ Object
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 |