Module: CaRuby::JSON::Deserializer

Defined in:
lib/caruby/json/deserializer.rb

Overview

JSON => Jinx::Resource deserializer.

Instance Method Summary collapse

Instance Method Details

#json_create(json) ⇒ Jinx::Resource

Returns the deserialized object.

Parameters:

  • json (String)

    the JSON to deserialize

Returns:

  • (Jinx::Resource)

    the deserialized object



9
10
11
12
# File 'lib/caruby/json/deserializer.rb', line 9

def json_create(json)
  # Make the new object from the json data attribute => value hash.
  new(json['data'])
end