-
Notifications
You must be signed in to change notification settings - Fork 54
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
Hash#dig and Hash#fetch patches #56
Comments
@maxp-edcast I'll take a look at adding special version of A bit of rumination:
|
I have added improved |
awesome thanks. |
Not sure why, but when I use the To fix this I added the following patch:
|
Can you provide a code sample, Ruby version, and full error stack trace? I don't know under what circumstance that |
Yes you are correct, it was because I was passing a RecursiveOpenStruct to RecursiveOpenstruct.new. Is there a particular reason this is not supported? Is it a result of the desire to have as little an API footprint as possible? |
In general, ROS tries to be a strict extension to OpenStruct, and OpenStruct only accepts a hash as its input. While I could do something like have the initializer for ROS call |
Took me a bit of time to realize my code was failing because RecursiveOpenStruct#dig (inherited from Hash) returns a plain Hash.
I am using the following patch:
What are your thoughts on adding this function here?
While I'm at it, I also added a
RecursiveOpenStruct#fetch
method, because I found myself using it in code before realizing it didn't exist:The text was updated successfully, but these errors were encountered: