Method: OpenC3::SortedModel.all

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

.all(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



50
51
52
53
# File 'lib/openc3/models/sorted_model.rb', line 50

def self.all(scope:, limit: 100)
  result = Store.zrevrangebyscore(self.pk(scope), '+inf', '-inf', limit: [0, limit])
  result.map { |item| JSON.parse(item, :allow_nan => true, :create_additions => true) }
end