class Syzygies::Word

Attributes

first_two_letters[R]
last_two_letters[R]
parents[RW]
word[R]

Public Class Methods

new(word) click to toggle source
# File lib/syzygies/word.rb, line 16
def initialize(word)
        @parents = [word.upcase]
        @word = word.upcase
        @first_two_letters = word[0..1].upcase
        @last_two_letters = word[-2..-1].upcase
end

Public Instance Methods

<=>(other) click to toggle source
# File lib/syzygies/word.rb, line 23
def <=>(other)
        @word <=> other
end
addParent(parent) click to toggle source
# File lib/syzygies/word.rb, line 27
def addParent(parent)
        @parents = parent.parents + [@word] 
        return self
end