We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The extension of Hash#dig isn't compatible with the core method and can cause some horrible stuff to happen. E.g.
>> g = { foo: [10, 11, 12] } => {:foo=>[10, 11, 12]} >> g.dig(:foo, 1) => 11 >> class Hash >> def dig(*path) >> path.inject(self) do |location, key| ?> location.respond_to?(:keys) ? location[key] : nil >> end >> end >> end => :dig >> g = { foo: [10, 11, 12] } => {:foo=>[10, 11, 12]} >> g.dig(:foo, 1) => nil >>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The extension of Hash#dig isn't compatible with the core method and can cause some horrible stuff to happen. E.g.
The text was updated successfully, but these errors were encountered: