Class: Springcm::ResourceList
- Inherits:
-
Object
- Object
- Object
- Springcm::ResourceList
show all
- Defined in:
- lib/springcm-sdk/resource_list.rb
Overview
A list object of arbitrary SpringCM resources. Allows for easy navigation of paged resources like documents and attribute groups. All resources that are retrieved in this manner are attached to a parent object, e.g. the account for attribute groups, or a folder for documents.
Instance Method Summary
collapse
Methods inherited from Object
#method_missing, #raw
Constructor Details
#initialize(data, parent_object, kind, client, method_override: nil) ⇒ ResourceList
Returns a new instance of ResourceList.
7
8
9
10
11
12
|
# File 'lib/springcm-sdk/resource_list.rb', line 7
def initialize(data, parent_object, kind, client, method_override: nil)
@parent_object = parent_object
@kind = kind
@method_override = method_override
super(data, client)
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Springcm::Object
Instance Method Details
22
23
24
|
# File 'lib/springcm-sdk/resource_list.rb', line 22
def first
nav_list("First")
end
|
30
31
32
33
34
|
# File 'lib/springcm-sdk/resource_list.rb', line 30
def items
@data.fetch("Items", []).map { |item|
@kind.new(item, @client)
}
end
|
26
27
28
|
# File 'lib/springcm-sdk/resource_list.rb', line 26
def last
nav_list("Last")
end
|
14
15
16
|
# File 'lib/springcm-sdk/resource_list.rb', line 14
def next
nav_list("Next")
end
|
18
19
20
|
# File 'lib/springcm-sdk/resource_list.rb', line 18
def prev
nav_list("Previous")
end
|