Class: Retell::SDK::Unofficial::BaseList
- Inherits:
-
Object
- Object
- Retell::SDK::Unofficial::BaseList
show all
- Includes:
- Enumerable
- Defined in:
- lib/retell/sdk/unofficial/base_list.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(items_key, raw_response) ⇒ BaseList
Returns a new instance of BaseList.
9
10
11
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 9
def initialize(items_key, raw_response)
@items = raw_response[items_key]
end
|
Instance Attribute Details
#items ⇒ Object
Returns the value of attribute items.
7
8
9
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 7
def items
@items
end
|
Instance Method Details
#[](index) ⇒ Object
13
14
15
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 13
def [](index)
@items[index]
end
|
#each ⇒ Object
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 17
def each
if block_given?
to_a.each do |value|
yield(value)
end
to_a
else
to_enum(:each)
end
end
|
#empty? ⇒ Boolean
38
39
40
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 38
def empty?
@items.empty?
end
|
#first ⇒ Object
42
43
44
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 42
def first
@items.first
end
|
#last ⇒ Object
46
47
48
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 46
def last
@items.last
end
|
#length ⇒ Object
Also known as:
size
28
29
30
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 28
def length
@items.length
end
|
#to_a ⇒ Object
34
35
36
|
# File 'lib/retell/sdk/unofficial/base_list.rb', line 34
def to_a
@items
end
|