Last active
January 19, 2018 11:19
-
-
Save ilyakrasnov/22e29b10ad05030929c31d681fc91c45 to your computer and use it in GitHub Desktop.
Simple 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 | |
attr_accessor :name, :id, :address | |
def initialize(name, id, address) | |
@name = name | |
@id = id | |
@address = address | |
end | |
def where_do_you_live | |
puts "My address is: #{address}" | |
end | |
def show_passport | |
puts "Passport id is: #{id}" | |
end | |
def greet | |
puts "Hi, my name is #{name}" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment