Class: Rack::JSON::JSONDocument

Inherits:
Document
  • Object
show all
Defined in:
lib/rackjson/json_document.rb

Instance Attribute Summary

Attributes inherited from Document

#attributes

Instance Method Summary collapse

Methods inherited from Document

#add_attributes, create, #field, #set_id, #to_h, #to_json

Constructor Details

#initialize(doc) ⇒ JSONDocument

Returns a new instance of JSONDocument.



4
5
6
7
# File 'lib/rackjson/json_document.rb', line 4

def initialize(doc)
  @attributes = JSON.parse(doc)
  set_attributes
end