Skip to content

Instantly share code, notes, and snippets.

@worker8
Created October 16, 2012 06:47
Show Gist options
  • Select an option

  • Save worker8/3897600 to your computer and use it in GitHub Desktop.

Select an option

Save worker8/3897600 to your computer and use it in GitHub Desktop.
method
class String
def perform code
code.call(self)
end
end
#=== method ====
method_string = "Hey there, "
def func n
puts n + "from a method!"
end
method_string.perform method(:func)
#=== Result ===
Hey there, from a lambda!
@wteuber

wteuber commented Jul 11, 2013

Copy link
Copy Markdown

Fix...
line 16: Hey there, from a method!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment