If you check Ruby 2.5.1's version of the documentation - ruby-doc.org/stdlib-2.5.1/libdoc/o... - you'll notice that data.to_h does not support the additional block, that's why it returns the unchanged format.
Started out teaching English at Embry-Riddle.
Graded 10,000 essays.
Lesson learned.
Became a mathematics teacher.
Discovered computing.
Never looked back.
Location
Houston TX
Education
Stetson University: B.A., M.A. in English; M.S. in mathematics
Wow! Thanks, @rhymes
! I have 2.5.3 installed, so you're correct. Looking over at rubyinstaller.org/, I see the recommendation to stay with 2.5 for now.
For the post I'm writing, I think I'll specify which Ruby version I'm writing about.
What Ruby version are you using?
I've tried with Ruby 2.6.3 and it behaves exactly like in the documentation:
With Ruby 2.5.1 it behaves like in your example:
If you check Ruby 2.5.1's version of the documentation - ruby-doc.org/stdlib-2.5.1/libdoc/o... - you'll notice that
data.to_h
does not support the additional block, that's why it returns the unchanged format.Wow! Thanks, @rhymes ! I have 2.5.3 installed, so you're correct. Looking over at rubyinstaller.org/, I see the recommendation to stay with 2.5 for now.
For the post I'm writing, I think I'll specify which Ruby version I'm writing about.
Yeah, unfortunately Ruby's support on Windows isn't great :(