Created
December 17, 2013 16:04
-
-
Save ruslanpa/8007343 to your computer and use it in GitHub Desktop.
User 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 User | |
attr_accessor :name, :surname | |
def initialize(name, surname) | |
@name, @surname = name, surname | |
end | |
def full_name | |
"#{name} #{surname}" | |
end | |
def to_s | |
full_name | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment