Module: HALDecorator::Deserializer

Included in:
HALDecorator
Defined in:
lib/hal_decorator/deserializer.rb

Defined Under Namespace

Classes: Error

Instance Method Summary collapse

Instance Method Details

#from_hal(payload, resource = nil) ⇒ Object



13
14
15
16
17
# File 'lib/hal_decorator/deserializer.rb', line 13

def from_hal(payload, resource = nil)
  return if payload.nil? || payload.empty?
  hash = JSON.parse(payload)
  from_hash(hash, resource)
end