Class: Rack::JSON::JSONDocument
- Defined in:
- lib/rackjson/json_document.rb
Instance Attribute Summary
Attributes inherited from Document
Instance Method Summary collapse
-
#initialize(doc) ⇒ JSONDocument
constructor
A new instance of JSONDocument.
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 |