Skip to content

Instantly share code, notes, and snippets.

@murajun1978
Created June 1, 2014 14:02
Show Gist options
  • Save murajun1978/5fa655a6a7cf8f09d730 to your computer and use it in GitHub Desktop.
Save murajun1978/5fa655a6a7cf8f09d730 to your computer and use it in GitHub Desktop.
class Murajun
def initialize(name)
@name = name
end
def murajun?
@name == "murajun"
end
end
class Name
def hello_murajun(name)
if name.murajun?
"Hello, murajun."
else
"You're not murajun."
end
end
end
murajun = Murajun.new("murajun1978")
name = Name.new
p name.hello_murajun(murajun) # => You're not murajun.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment