move adapter stuff around
This commit is contained in:
@ -50,7 +50,7 @@ module Parfait
|
||||
ret
|
||||
end
|
||||
alias :[] :get
|
||||
|
||||
|
||||
def grow_to( len )
|
||||
raise "Only positive lenths, #{len}" if len < 0
|
||||
old_length = get_length
|
||||
@ -253,15 +253,4 @@ module Parfait
|
||||
end
|
||||
end
|
||||
|
||||
# new list from ruby array to be precise
|
||||
def self.new_list array
|
||||
list = Parfait::List.new
|
||||
list.set_length array.length
|
||||
index = 0
|
||||
while index < array.length do
|
||||
list.set(index , array[index])
|
||||
index = index + 1
|
||||
end
|
||||
list
|
||||
end
|
||||
end
|
||||
|
@ -191,14 +191,4 @@ module Parfait
|
||||
end
|
||||
end
|
||||
|
||||
# Word from string
|
||||
def self.new_word( string )
|
||||
string = string.to_s if string.is_a? Symbol
|
||||
word = Word.new( string.length )
|
||||
string.codepoints.each_with_index do |code , index |
|
||||
word.set_char(index , code)
|
||||
end
|
||||
word
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user