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



71
72
73
74
75
76
77
78
# File 'lib/openc3/models/activity_model.rb', line 71

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