controlshift / action-network-rest

Ruby client for interacting with the ActionNetwork REST API
MIT License
8 stars 4 forks source link

Hashie takes issue with "index" on ActionNetwork's entry point #13

Open mashedkeyboard opened 4 years ago

mashedkeyboard commented 4 years ago

Hi folks, thanks for this great library!

On running client.entry_point.authenticated_successfully?, you will see the following warning:

You are setting a key that conflicts with a built-in method Hashie::Mash#index defined in Hash. This can cause unexpected behavior when accessing the key as a property. You can still access the key via the #[] method.

This warning is, of course, largely inconsequential, as a result of the fact that the only presence of index as a key is in the docs link. However, it's still a warning, so it might be an idea to try and address it in some way or another. It looks like the only real way of doing that would be switching away from Hashie in Vertebrae, though, so it may be a WONTFIX.

woodhull commented 4 years ago

Switching out hashie for a more carefully crafted approach is not high on our internal priority list right now (the code as is works for our use cases), but we would of course welcome and consider a PR with a change to improve the json parsing.

Hashie is a bit of a hammer/code smell, (the memory usage is worrying too!) but it makes it so easy to work with arbitrary json input in a ruby-like manner.