Commit Graph

3 Commits

Author SHA1 Message Date
Caroline Artz 0bca9255a6
Changes to `Mash` initialization key string conversion. (#521) 2020-05-04 21:15:32 -04:00
Koichi ITO 570409727e Suppress keyword arguments warning for Ruby 2.7.0
This PR suppresses the following keyword arguments warning for Ruby 2.7.0.

```console
% bundle exec rspec spec/hashie/extensions/mash/symbolize_keys_spec.rb
(snip)

/Users/koic/src/github.com/hahie/hashie/spec/hashie/extensions/mash/symbolize_keys_spec.rb:29:
warning: Using the last argument as keyword parameters is
deprecated; maybe ** should be added to the call
/Users/koic/src/github.com/hahie/hashie/spec/hashie/extensions/mash/symbolize_keys_spec.rb:21:
warning: The called method `call' is defined here
```

For Ruby 2.8.0-dev (Ruby 3.0) the warning will be `ArgumentError`.
ruby/ruby#2794
2020-01-15 12:53:57 +09:00
Michael Herold 5fa3ebc132
Add Hashie::Extensions::Mash::SymbolizeKeys
We often have requests to make Mash symbolize keys by default. Since
Hashie is used across so many different version of Ruby, we have been
hesitant to make this behavior the default. However, there are valid use
cases for wanting symbol keys.

To satisfy both the needs of those on older Rubies and the needs of
those who want symbol keys, this extension gives the end-user the
ability to toggle on symbolized keys in their Mash subclasses. By adding
this ability, we can wait to implement the symbol keys as a default for
a while longer.

See #341, #342 for more information. This is a half-measure toward the
implementation of #342 (which makes Mash symbolize keys by default).
2017-02-20 07:58:24 -06:00