Method: OpenC3::TriggerModel.from_json
- Defined in:
- lib/openc3/models/trigger_model.rb
.from_json(json, name:, scope:) ⇒ TriggerModel
Returns Model generated from the passed JSON.
299 300 301 302 303 304 305 |
# File 'lib/openc3/models/trigger_model.rb', line 299 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? json.transform_keys!(&:to_sym) self.new(**json, name: name, scope: scope) end |