Method: OpenC3::ReactionModel.from_json
- Defined in:
- lib/openc3/models/reaction_model.rb
.from_json(json, name:, scope:) ⇒ ReactionModel
Returns Model generated from the passed JSON.
274 275 276 277 278 |
# File 'lib/openc3/models/reaction_model.rb', line 274 def self.from_json(json, name:, scope:) json = JSON.parse(json, :allow_nan => true, :create_additions => true) if String === json raise "json data is nil" if json.nil? self.new(**json.transform_keys(&:to_sym), name: name, scope: scope) end |