Iteration
Methods
first?
last?
new
Attributes
[R] | after | |
[R] | index | |
[R] | prior | |
[R] | value |
Public Class methods
[ + ]
# 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
[ + ]
# File lib/more/facets/iteration.rb, line 14 def first? ; @index == 0 ; end
[ + ]
# File lib/more/facets/iteration.rb, line 15 def last? if Enumerable === self nil else @index == @array.length end end