Module: Unit::ResourceOperations::List::ClassMethods
- Defined in:
- lib/unit-ruby/util/resource_operations.rb
Instance Method Summary collapse
-
#list(where: {}, limit: 100, offset: 0, sort: nil) ⇒ Object
List resources.
Instance Method Details
#list(where: {}, limit: 100, offset: 0, sort: nil) ⇒ Object
List resources
55 56 57 58 59 60 61 |
# File 'lib/unit-ruby/util/resource_operations.rb', line 55 def list(where: {}, limit: 100, offset: 0, sort: nil) params = { filter: where, page: { offset: offset, limit: limit }, sort: sort }.compact resources = connection.get(resources_path, params) resources.map { |resource| build_resource_from_json_api(resource) } end |