Last active
May 28, 2016 01:39
-
-
Save amarkpark/d6570856b3531c475513 to your computer and use it in GitHub Desktop.
This file contains 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
class Coffee | |
attr_accessor :brew | |
def initialize(brew) | |
@brew = brew.upcase.chr # accounts for multiple cases, spellings & typos | |
if @brew == "R" | |
@brew = "Regular" | |
puts "Mmm... Dark rich fully-leaded goodness!" | |
elsif @brew == "D" | |
@brew = "Decaf" | |
puts "Finest decaf in the state, coming right up!" | |
end | |
end | |
def refill | |
puts "Regular or Decaf?" | |
Coffee.new("#{gets.chomp}") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment