Module: Roar::JSON::InstanceMethods

Defined in:
lib/roar/json.rb

Instance Method Summary collapse

Instance Method Details

#deserialize(*args) ⇒ Object


29
30
31
# File 'lib/roar/json.rb', line 29

def deserialize(*args)
  from_json(*args)
end

#from_json(document, options = {}) ⇒ Object


18
19
20
21
22
# File 'lib/roar/json.rb', line 18

def from_json(document, options={})
  document = '{}' if document.nil? or document.empty?

  super
end

#serialize(*args) ⇒ Object

Generic entry-point for rendering.


25
26
27
# File 'lib/roar/json.rb', line 25

def serialize(*args)
  to_json(*args)
end