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.
271 272 273 274 275 |
# File 'lib/openc3/models/reaction_model.rb', line 271 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 |