Skip to content

Instantly share code, notes, and snippets.

@sinefunc
Created May 26, 2010 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sinefunc/414147 to your computer and use it in GitHub Desktop.
Save sinefunc/414147 to your computer and use it in GitHub Desktop.
def pcall(object, method)
return if not object.respond_to?(method)
object.send(method)
rescue
nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment