Skip to content

Instantly share code, notes, and snippets.

@plusplus
Last active December 30, 2015 02:19
Show Gist options
  • Save plusplus/7761832 to your computer and use it in GitHub Desktop.
Save plusplus/7761832 to your computer and use it in GitHub Desktop.
class MultiplyTask
def call(a,b)
a * b
end
end
task1 = MultiplyTask.new
task2 = ->(a,b) {a * b}
task1.(2,4)
# => 8
task2.(2,4)
# => 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment