NAME

Game::WordBrain::Word - Representation of a Word for WordBrain

SYNOPSIS

    # Create a new word
    my @letters = (
        Game::WordBrain::Letter->new( ... ),
        Game::WordBrain::Letter->new( ... ),
        ...;
    );

    my $word = Game::WordBrain::Word->new( letters => \@letters );

    # Stringify
    print $word;            # Overloaded Stringification
    print $word->word;      # Explict stringification

DESCRIPTION

A Game::WordBrain::Word is composed of an ArrayRef of Game::WordBrain::Letters that are used to construct it.

ATTRIBUTES

letters

An ArrayRefof Game::WordBrain::Letters that comprise the word.

METHODS

new

    my @letters = (
        Game::WordBrain::Letter->new( ... ),
        Game::WordBrain::Letter->new( ... ),
        ...;
    );

    my $word = Game::WordBrain::Word->new( letters => \@letters );

Given an ArrayRef of Game::WordBrain::Letters, create a new potential WordBrain word.

word

    my $word = Game::WordBrain::Word->new( ... );

    print $word->word;

Explict stringification of the word. There is also overloaded " stringification but you are free to use which ever method you are most comfortable with.