Class: Uplink::ObjectIterator
- Inherits:
-
Object
- Object
- Uplink::ObjectIterator
- Defined in:
- lib/uplink/object.rb
Instance Method Summary collapse
-
#initialize(object_iterator) ⇒ ObjectIterator
constructor
A new instance of ObjectIterator.
- #item ⇒ Object
- #next? ⇒ Boolean
Constructor Details
#initialize(object_iterator) ⇒ ObjectIterator
Returns a new instance of ObjectIterator.
24 25 26 |
# File 'lib/uplink/object.rb', line 24 def initialize(object_iterator) @object_iterator = object_iterator end |
Instance Method Details
#item ⇒ Object
42 43 44 45 46 47 |
# File 'lib/uplink/object.rb', line 42 def item object = UplinkLib.uplink_object_iterator_item(@object_iterator) Object.new(nil, object) ensure UplinkLib.uplink_free_object(object) if object end |
#next? ⇒ Boolean
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/uplink/object.rb', line 28 def next? has_next = UplinkLib.uplink_object_iterator_next(@object_iterator) unless has_next begin error = UplinkLib.uplink_object_iterator_err(@object_iterator) ErrorUtil.handle_error(error) ensure UplinkLib.uplink_free_error(error) if error end end has_next end |