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

Add mutation from foo === barbar.kind_of?(foo) #689

Closed
backus opened this issue Nov 4, 2016 · 2 comments · Fixed by #1188
Closed

Add mutation from foo === barbar.kind_of?(foo) #689

backus opened this issue Nov 4, 2016 · 2 comments · Fixed by #1188

Comments

@backus
Copy link
Contributor

backus commented Nov 4, 2016

Threequals might be more powerful than the use case requires

String === 'foo'                       # => true
/foo/  === 'foo'                       # => true
->(value) { value == 'foo' } === 'foo' # => true
@dkubb
Copy link
Collaborator

dkubb commented Nov 4, 2016

This is more a style issue, but I tend to prefer #kind_of? due to it's similarity to #instance_of?, which is a stronger form of the test.

@backus
Copy link
Contributor Author

backus commented Nov 4, 2016

Sure I can make it kind_of?

@backus backus changed the title Add mutation from foo === barbar.is_a?(foo) Add mutation from foo === barbar.kind_of?(foo) Nov 4, 2016
dgollahon added a commit that referenced this issue Jan 2, 2021
- Closes #689
  * NOTE: I have gone with `is_a?` over `kind_of?` because [this is more commonly used](https://github.com/rubocop-hq/ruby-style-guide#is-a-vs-kind-of)
dgollahon added a commit that referenced this issue Jan 2, 2021
- Closes #689
  * NOTE: I have gone with `is_a?` over `kind_of?` because [this is more commonly used](https://github.com/rubocop-hq/ruby-style-guide#is-a-vs-kind-of)
dgollahon added a commit that referenced this issue Jan 2, 2021
- Closes #689
  * NOTE: I have gone with `is_a?` over `kind_of?` because [this is more commonly used](https://github.com/rubocop-hq/ruby-style-guide#is-a-vs-kind-of)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants