Method: OpenC3::ActivityModel.all

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

.all(name:, scope:, limit: 100) ⇒ Array<Hash>

Returns Array up to the limit of the models (as Hash objects) stored under the primary key.

Returns:

  • (Array<Hash>)

    Array up to the limit of the models (as Hash objects) stored under the primary key



63
64
65
66
# File 'lib/openc3/models/activity_model.rb', line 63

def self.all(name:, scope:, limit: 100)
  array = Store.zrange("#{scope}#{PRIMARY_KEY}__#{name}", 0, -1, :limit => [0, limit])
  return array.map { |value| JSON.parse(value, :allow_nan => true, :create_additions => true) }
end