Method: OpenC3::ScopeModel.from_json
- Defined in:
- lib/openc3/models/scope_model.rb
.from_json(json, scope: nil) ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/openc3/models/scope_model.rb', line 49 def self.from_json(json, scope: nil) json = JSON.parse(json, :allow_nan => true, :create_additions => true) if String === json raise "json data is nil" if json.nil? json.transform_keys!(&:to_sym) self.new(**json, scope: scope) end |