Class: Height::ListResponse
- Inherits:
-
Object
- Object
- Height::ListResponse
- Includes:
- Enumerable
- Defined in:
- lib/height/list_response.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Class Method Summary collapse
Instance Method Summary collapse
- #count ⇒ Object
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(items) ⇒ ListResponse
constructor
A new instance of ListResponse.
- #last ⇒ Object
Constructor Details
#initialize(items) ⇒ ListResponse
Returns a new instance of ListResponse.
20 21 22 |
# File 'lib/height/list_response.rb', line 20 def initialize(items) @items = items end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
18 19 20 |
# File 'lib/height/list_response.rb', line 18 def items @items end |
Class Method Details
Instance Method Details
#count ⇒ Object
28 29 30 |
# File 'lib/height/list_response.rb', line 28 def count @items.count end |
#each(&block) ⇒ Object
32 33 34 |
# File 'lib/height/list_response.rb', line 32 def each(&block) @items.each(&block) end |
#empty? ⇒ Boolean
24 25 26 |
# File 'lib/height/list_response.rb', line 24 def empty? count.zero? end |
#last ⇒ Object
36 37 38 |
# File 'lib/height/list_response.rb', line 36 def last @items.last end |