class Cursor
Public Class Methods
new(array, start=0)
click to toggle source
# File lib/quantile_estimator/cursor.rb, line 2 def initialize(array, start=0) @array = array @start = start end
Public Instance Methods
next()
click to toggle source
# File lib/quantile_estimator/cursor.rb, line 17 def next Cursor.new(@array, @start + 1) end
previous()
click to toggle source
# File lib/quantile_estimator/cursor.rb, line 21 def previous Cursor.new(@array, @start - 1) end
remove!()
click to toggle source
# File lib/quantile_estimator/cursor.rb, line 13 def remove! @array.delete_at(@start) end
~()
click to toggle source
# File lib/quantile_estimator/cursor.rb, line 7 def ~ if @start >= 0 @array[@start] end end