Created
April 23, 2013 22:44
-
-
Save mjhea0/5448053 to your computer and use it in GitHub Desktop.
super basic ruby class
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 Person | |
# initialize fire's up each object in the class | |
def initialize(name) | |
# @ indicates that the variable is attached to the instance of the class | |
@name = name | |
end | |
def name | |
puts "Hi, my name is #{@name}." | |
end | |
end | |
me = Person.new("Michael Herman") | |
me.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment