Class: About_Pos::Enum
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(dir, arr) ⇒ Enum
constructor
A new instance of Enum.
Constructor Details
Instance Method Details
#each ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/about_pos.rb', line 22 def each return nil if @arr.empty? has_next = false begin result = yield @meta.value, @meta.real_index, @meta has_next = @meta.next? if has_next @meta.next! end end while has_next end |