Created
April 3, 2018 05:37
-
-
Save mykiy/9a85e5fea454fee09fd3388b9a3d269d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 Work | |
def initialize(name) | |
@name = name | |
end | |
def name | |
@name | |
end | |
def name=(name) | |
@name = name | |
end | |
def greet(other) | |
p "hi #{other.name}, i am #{@name}" | |
end | |
end | |
person = Work.new("velu") | |
friend = Work.new("prasanth") | |
person.greet(friend) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment