Created
October 9, 2014 15:13
-
-
Save danielbonnell/04b4e76785a2e296f801 to your computer and use it in GitHub Desktop.
person
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 | |
def initialize(first_name,last_name) | |
@first_name = first_name | |
@last_name = last_name | |
@full_name = @first_name + " " + @last_name | |
end | |
def print | |
puts "My name is #{@full_name}." | |
puts "My name is #{@first_name} #{@last_name}." | |
end | |
end | |
john = Person.new('John','Hamm') | |
john.print |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment