Class: Accessory::TraversalPosition::EnumerableAtOffset
- Inherits:
-
Object
- Object
- Accessory::TraversalPosition::EnumerableAtOffset
- Defined in:
- lib/accessory/traversal_position/enumerable_at_offset.rb
Overview
Represents an element encountered during #each traversal of an Enumerable.
Instance Attribute Summary collapse
-
#elem_at ⇒ Object
readonly
The element under the cursor, if applicable.
-
#offset ⇒ Integer
readonly
The offset of
elem_atin the Enumerable.
Instance Method Summary collapse
-
#first? ⇒ Boolean
True when #elem_at is the first element of the
Enumerable. -
#last? ⇒ Boolean
True when #elem_at is the last element of the
Enumerable.
Instance Attribute Details
#elem_at ⇒ Object (readonly)
21 22 23 |
# File 'lib/accessory/traversal_position/enumerable_at_offset.rb', line 21 def elem_at @elem_at end |
#offset ⇒ Integer (readonly)
18 19 20 |
# File 'lib/accessory/traversal_position/enumerable_at_offset.rb', line 18 def offset @offset end |
Instance Method Details
#first? ⇒ Boolean
24 |
# File 'lib/accessory/traversal_position/enumerable_at_offset.rb', line 24 def first?; @is_first; end |
#last? ⇒ Boolean
27 |
# File 'lib/accessory/traversal_position/enumerable_at_offset.rb', line 27 def last?; @is_last; end |