Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use better method name, we must #14970

Closed
wants to merge 1 commit into from
Closed

Conversation

@cpjolicoeur
Copy link

cpjolicoeur commented May 4, 2014

No description provided.

May the 4th be with you...
@carlosantoniodasilva

This comment has been minimized.

Copy link
Member

carlosantoniodasilva commented May 4, 2014

Thank you, I think we should either do or do not accept the change, but for now I'll give it a try with do not.

May the 4th be with you... 💚💛❤️💙💜

@agrberg

This comment has been minimized.

Copy link

agrberg commented May 4, 2014

👍

@rfunduk

This comment has been minimized.

Copy link

rfunduk commented May 4, 2014

Maybe this would have been accepted if it also had a test to ensure there is no try? :)

def test_there_is_no_try
  assert_raises(NoMethodError) { @string.try(:to_s) }
  # or maybe just...
  assert !@string.respond_to?(:try)
end
@agrberg

This comment has been minimized.

Copy link

agrberg commented May 4, 2014

I prefer

DoOrDoNotError = Class.new(StandardError)

def try(*a, &b)
  raise DoOrDoNotError, 'There is no try'
end
@snackycracky

This comment has been minimized.

Copy link

snackycracky commented May 5, 2014

try is so java :D

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