Skip to content

Conversation

@Slavunderkind
Copy link
Owner

No description provided.

@Slavunderkind Slavunderkind requested review from a user and vasil-gochev January 20, 2017 07:28
@Slavunderkind Slavunderkind changed the title [Ascii letter] Add child class representing letter object [Ascii art] Add child class representing letter object Jan 20, 2017
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to extract the input places (gets) out of the class and pass the values to initialize.

end

def letter_index(letter)
ascii_style = ('A'..'Z').to_a << '?'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move it to a constant AsciiArt::Letter::LETTERS, so that it reserves memory once.

LETTERS = [('A'..'Z').to_a, '?'].flatten

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also do

LETTERS = ('A'..'Z').to_a << '?'

to reserve even more memory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants