more parfait ripples
changes due to previous changes in parfait api
This commit is contained in:
@ -26,9 +26,9 @@ module Parfait
|
||||
# set the names of the instance variables in one go
|
||||
# used while booting the classes. At runtime the list would grow dynamically
|
||||
def set_names list
|
||||
self.set_length list.length
|
||||
self.set_length list.get_length
|
||||
index = 0
|
||||
while index < list.length do
|
||||
while index < list.get_length do
|
||||
list.set(index , array.get(index))
|
||||
end
|
||||
end
|
||||
|
@ -79,7 +79,7 @@ module Parfait
|
||||
end
|
||||
|
||||
def grow_to(len)
|
||||
raise "Only positive lenths, #{len}" if len <= 0
|
||||
raise "Only positive lenths, #{len}" if len < 0
|
||||
old_length = self.get_length
|
||||
return if old_length >= len
|
||||
internal_object_grow(len + 1)
|
||||
|
@ -37,7 +37,7 @@ module Parfait
|
||||
|
||||
def get_layout()
|
||||
puts "ME #{self.class}"
|
||||
return internal_object_get(LAYOUT)
|
||||
return internal_object_get(LAYOUT_INDEX)
|
||||
end
|
||||
|
||||
# class stores the "latest" layout for instances, ie the layout a new object will
|
||||
|
@ -37,6 +37,7 @@ module Parfait
|
||||
counter = self.length()
|
||||
return if counter >= len
|
||||
internal_object_grow( len + 1)
|
||||
counter = counter + 1
|
||||
while( counter < len)
|
||||
set_char( counter , fill_char)
|
||||
counter = counter + 1
|
||||
@ -57,7 +58,8 @@ module Parfait
|
||||
def range_correct_index at
|
||||
index = at
|
||||
index = self.length + at if at < 0
|
||||
raise "index out of bounds #{at} > #{self.length}" if (index < 0) or (index > self.length)
|
||||
raise "index must be positive , not #{at}" if (index <= 0)
|
||||
raise "index too large #{at} > #{self.length}" if (index > self.length)
|
||||
return index
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user