Method: OpenC3::Model.get_model

Defined in:
lib/openc3/models/model.rb

.get_model(name:, scope:) ⇒ Object|nil

Calls self.get and then from_json to turn the Hash configuration into a Ruby Model object.

Returns:

  • (Object|nil)

    Model object or nil if name not found under primary_key



94
95
96
97
98
99
100
101
# File 'lib/openc3/models/model.rb', line 94

def self.get_model(name:, scope:)
  json = get(name: name, scope: scope)
  if json
    return from_json(json, scope: scope)
  else
    return nil
  end
end