Class: TC_JSON::SubHash

Inherits:
Hash
  • Object
show all
Defined in:
lib/vendor/json_pure/tests/test_json.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.json_create(o) ⇒ Object



183
184
185
186
# File 'lib/vendor/json_pure/tests/test_json.rb', line 183

def self.json_create(o)
  o.delete JSON.create_id
  new.merge(o)
end

Instance Method Details

#to_json(*a) ⇒ Object



177
178
179
180
181
# File 'lib/vendor/json_pure/tests/test_json.rb', line 177

def to_json(*a)
  {
    JSON.create_id => self.class.name,
  }.merge(self).to_json(*a)
end