Skip to content

Instantly share code, notes, and snippets.

@joho
Created November 18, 2009 11:34
Show Gist options
  • Save joho/237759 to your computer and use it in GitHub Desktop.
Save joho/237759 to your computer and use it in GitHub Desktop.
object#respond_to for mutltiple methods at once
class Object
# sometimes it's handy to know
def respond_to_any?(*method_names)
method_names.any? { |method_name| respond_to?(method_name) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment