Skip to content

Instantly share code, notes, and snippets.

@joecorcoran
Created February 27, 2017 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joecorcoran/3af0f85532c82150b600ecaa1063fe53 to your computer and use it in GitHub Desktop.
Save joecorcoran/3af0f85532c82150b600ecaa1063fe53 to your computer and use it in GitHub Desktop.
call
# Use the method #call on each of these
# examples, to return the value `:hi`
class One
def call
:hi
end
end
class Two
def self.call
:hi
end
end
def three(&block)
block.call
end
four = -> { :hi }
five = ->(x) { x }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment