Module: Ably::Modules::ModelCommon::ClassMethods
- Defined in:
- lib/ably/modules/model_common.rb
Instance Method Summary collapse
-
#from_json(json_like_object) ⇒ Object
Return a new instance of this object using the provided JSON-like object or JSON string.
Instance Method Details
#from_json(json_like_object) ⇒ Object
Return a new instance of this object using the provided JSON-like object or JSON string
67 68 69 70 71 72 73 |
# File 'lib/ably/modules/model_common.rb', line 67 def from_json(json_like_object) if json_like_object.kind_of?(String) new(JSON.parse(json_like_object)) else new(json_like_object) end end |