class List
Attributes
h[RW]
protected - in ruby this doesn't play well with static/inline methods
length[RW]
q[RW]
Public Class Methods
new()
click to toggle source
# File lib/lib/list.rb, line 6 def initialize @length = 0 end
Public Instance Methods
add(item)
click to toggle source
# File lib/lib/list.rb, line 19 def add(item) x = [item] if @h == nil @h = x else @q[1] = x end @q = x @length+=1 end
iterator()
click to toggle source
# File lib/lib/list.rb, line 30 def iterator ::X_List::ListIterator.new(@h) end