Skip to content

Conversation

@brandonc
Copy link

When an object responds to a method but says that it doesn't, it can
lead to unexpected behavior. See this article https://robots.thoughtbot.com/always-define-respond-to-missing-when-overriding

> item.id
> "12345"
> item.try(:id)
> nil
> item.respond_to?(:id)
> false

When an object responds to a method but says that it doesn't, it can
lead to unexpected behavior.

```
> item.id
> "12345"
> item.try(:id)
> nil
> item.respond_to?(:id)
> false
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant