Iteration
Methods
Attributes
[R] | after | |
[R] | index | |
[R] | prior | |
[R] | value |
Public Class methods
[ show source ]
# File lib/more/facets/iteration.rb, line 7 def initialize(array) @array = array @index = 0 @value = array[0] @prior = [] @after = array[1..-1] end
Public Instance methods
[ show source ]
# File lib/more/facets/iteration.rb, line 14 def first? ; @index == 0 ; end
[ show source ]
# File lib/more/facets/iteration.rb, line 15 def last? if Enumerable === self nil else @index == @array.length end end