get words to compare to strings

This commit is contained in:
Torsten Ruger 2015-05-24 15:31:44 +03:00
parent b58bba3fc4
commit 38cb9f7d3c

View File

@ -89,7 +89,17 @@ module Parfait
class Method
attr_accessor :info
end
class Word
def == other
return false unless other.is_a?(String) or other.is_a?(Word)
as_string = self.to_s
unless other.is_a? String
other = other.to_s
end
as_string == other
end
def to_s
string = ""
index = 1