Last active
December 26, 2015 09:29
-
-
Save octosteve/7129454 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Toy = Class.new do | |
def initialize name, description, player | |
@name = name | |
@description = description | |
@player = player | |
end | |
def player player_name | |
@player = player_name | |
end | |
def welcome | |
"Welcome to #{@name}, #{@player}! #{@description}" | |
end | |
end | |
skip_it = Toy.new "Skip it!", "Whirring ball of death", "Steven" | |
skip_it.welcome | |
skip_it.player "Eddie" | |
skip_it.welcome |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment