Skip to content

Instantly share code, notes, and snippets.

@ilyakrasnov
Last active January 19, 2018 11:19
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 ilyakrasnov/22e29b10ad05030929c31d681fc91c45 to your computer and use it in GitHub Desktop.
Save ilyakrasnov/22e29b10ad05030929c31d681fc91c45 to your computer and use it in GitHub Desktop.
Simple class
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