Skip to content
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

With indifferent access returns Hash on transformation methods (ruby 2.5.1) #1

Open
arturictus opened this issue Sep 4, 2018 · 0 comments

Comments

@arturictus
Copy link
Owner

When calling compact returns a Hash instead of indifferent_access

irb(main):001:0> h = Fusu::HashWithIndifferentAccess.new({hello: 'hello'})
=> {"hello"=>"hello"}
irb(main):002:0> h_c = h.compact
=> {"hello"=>"hello"}
irb(main):003:0> h_c.class
=> Hash
irb(main):004:0> h_c.fetch(:hello)
Traceback (most recent call last):
        3: from bin/console:14:in `<main>'
        2: from (irb):4
        1: from (irb):4:in `fetch'
KeyError (key not found: :hello)
@arturictus arturictus changed the title With indifferent access (ruby 2.5.1) With indifferent access returns hash on transformation methods (ruby 2.5.1) Sep 4, 2018
@arturictus arturictus changed the title With indifferent access returns hash on transformation methods (ruby 2.5.1) With indifferent access returns Hash on transformation methods (ruby 2.5.1) Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant