Created
February 10, 2014 08:16
-
-
Save vertis/8912174 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 Greeting | |
| def initialize(greeting="Hello") | |
| @greeting = greeting | |
| end | |
| def hello(name, options={}) | |
| puts "#{@greeting} #{name}" | |
| end | |
| end | |
| puts Greeting.new.hello("Luke") | |
| m = Greeting.new.method(:hello) | |
| p m.methods.sort | |
| p m.owner | |
| p m.name | |
| p m.arity | |
| p m.parameters | |
| m.call("Dave") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment