Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
arr = [:a, :b, :c]
def check_item(item)
item == :c
end
Object.class_eval do
alias ⅋ method
end
p arr.any?(&method(:check_item))
p arr.any? { |i| check_item(i) }
p arr.any?(&⅋(:check_item))
@plexus

This comment has been minimized.

Copy link

commented Nov 29, 2014

How about

arr.any? &→(:check_item)

?

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.