Class: Tinybucket::Iterator
- Inherits:
-
Object
- Object
- Tinybucket::Iterator
- Defined in:
- lib/tinybucket/iterator.rb
Overview
Iterator
This iterator iterate items by sending request ot Bitbucket Cloud REST API.
Instance Method Summary collapse
-
#initialize(api_client, method, *args) ⇒ Iterator
constructor
Constructor.
- #next ⇒ Object
-
#size ⇒ Fixnum, NillClas
Get collection size.
Constructor Details
#initialize(api_client, method, *args) ⇒ Iterator
Constructor
14 15 16 17 18 19 20 21 22 |
# File 'lib/tinybucket/iterator.rb', line 14 def initialize(api_client, method, *args) @client = api_client @method = method @args = args @attrs = {} @values = [] @pos = nil end |
Instance Method Details
#next ⇒ Object
24 25 26 |
# File 'lib/tinybucket/iterator.rb', line 24 def next next_value end |
#size ⇒ Fixnum, NillClas
Note:
This method return size attribute of object collection wrapper. So this method may return nil.
Get collection size.
38 39 40 41 |
# File 'lib/tinybucket/iterator.rb', line 38 def size load_next if next? @attrs[:size] end |