Method: Frodo::Entity.from_json
- Defined in:
- lib/frodo/entity.rb
.from_json(json, options = {}) ⇒ Frodo::Entity
Create Entity from JSON document with provided options.
152 153 154 155 156 157 158 159 160 161 |
# File 'lib/frodo/entity.rb', line 152 def self.from_json(json, = {}) return nil if json.nil? json = JSON.parse(json.to_s) unless json.is_a?(Hash) = (json) .merge!(context: ['@odata.context']) entity = with_properties(json, ) (entity, ) entity end |