Check if property exists in object
I spent a lot of time trying to figure this out myself with the help of other questions, but couldn't, so I really need to ask this again
I have the following object in ruby
(...)
:follow_request_sent:
:notifications:
:coordinates:
:place:
:contributors:
:favorite_count: 0
:entities:
:hashtags:
- :text:
:indices:
(...)
This object is the X . I want to check if x.place exists . I've tried EVERYTHING. any,?, include ?, with [hash] defined by ?, (...), but it ALWAYS throws an "undefined method" error when trying to access a property, whether it exists or not. It NEVER works and I don't understand why. This is the twitter API by the way. Does anyone imagine why? Please do not point me to the other answers, because basically they all failed.
+3
source to share