Created
April 14, 2016 08:17
-
-
Save krokrob/5c77383afd818833c153483b2d1fe259 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 Restaurant | |
#getter | |
attr_reader :name | |
# accessor | |
attr_accessor :city | |
def initialize(name, city) | |
@name = name | |
@city = city | |
end | |
end | |
alicheur = Restaurant.new("Alicheur", "Paris") | |
alicheur.city = "Bruxelles" | |
puts alicheur.name | |
puts alicheur.city |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment