Skip to content

Instantly share code, notes, and snippets.

@vertis
Created February 10, 2014 08:16
Show Gist options
  • Select an option

  • Save vertis/8912174 to your computer and use it in GitHub Desktop.

Select an option

Save vertis/8912174 to your computer and use it in GitHub Desktop.
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