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 Hello | |
def say_hello | |
puts "Hello!" | |
end | |
alias greet say_hello | |
end |
> h = Hello.new
=> #<Hello:0x9390ba8>
> h.say_hello
Hello!
=> nil
> h.greet
Hello!
=> nil
No comments:
Post a Comment