Checking for method implementation instead of rescuing NoMethodError as suggested by @geemus