Created
December 1, 2014 18:54
-
-
Save anonymous/5197cd83022678b9a517 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 Ticket | |
VENUES = ["Convention Center", "Fairgrounds", "Town Hall"] | |
attr_reader :venue, :date | |
attr_accessor :price | |
def initialize(venue, date) | |
if VENUES.include?(venue) | |
@venue = venue | |
else | |
raise ArgumentError, "Unknown venue #{venue}" | |
end | |
@date = date | |
end | |
end | |
puts "The venues are: #{Ticket::VENUES}" | |
# GENERATES ERROR: puts "The venues are: #{Ticket.VENUES}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment