-
-
Save havenwood/59a8920f6091a244c936 to your computer and use it in GitHub Desktop.
Ruby class instance methods and instance methods with instance variables example (irc).
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 MyApp | |
class << self | |
attr_accessor :version | |
end | |
attr_accessor :version | |
end | |
MyApp.version | |
app = MyApp.new | |
app.version | |
MyApp.version = 'class 0.0.0' | |
MyApp.version | |
app.version | |
app.version = 'instance 1.1.1' | |
app.version | |
MyApp.version |
Author
havenwood
commented
Jun 6, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment