Created
February 27, 2017 20:30
-
-
Save joecorcoran/3af0f85532c82150b600ecaa1063fe53 to your computer and use it in GitHub Desktop.
call
This file contains 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
# 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