Skip to content

Instantly share code, notes, and snippets.

@mjhea0
Created April 23, 2013 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjhea0/5448053 to your computer and use it in GitHub Desktop.
Save mjhea0/5448053 to your computer and use it in GitHub Desktop.
super basic ruby class
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