basic word functionality

and conversion from string
This commit is contained in:
Torsten Ruger
2015-05-14 20:39:12 +03:00
parent 5e0e8c8364
commit 164816c441
2 changed files with 68 additions and 3 deletions

View File

@ -48,3 +48,14 @@ class Parfait::List
internal_object_length
end
end
# Functions to generate parfait objects
String.class_eval do
def to_word
word = Parfait::Word.new( self.length )
codepoints.each_with_index do |code , index |
word.set_char(index , char)
end
word
end
end