Created
June 12, 2011 16:02
-
-
Save hechien/1021704 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 Store | |
attr_accessor :name | |
def initialize | |
@name = "N/A" | |
@@root = "Apple" | |
end | |
def root | |
@@root | |
end | |
def root=(_root) | |
@@root = _root | |
end | |
end | |
studio_a = Store.new | |
data_express = Store.new | |
puts studio_a.name | |
puts data_express.name | |
studio_a.name = "Studio A" | |
puts studio_a.name | |
puts data_express.name | |
data_express.name = "Data Express" | |
puts studio_a.name | |
puts data_express.name | |
puts studio_a.root | |
puts data_express.root | |
studio_a.root = "Microsoft" | |
puts studio_a.root | |
puts data_express.root |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment