6 kyu
Make Ruby Hashes Act Like JavaScript Objects
125 of 126bellmyer
Description:
Upgrade Ruby's Hash class to work like a JavaScript Object. For example:
hash = {:five => 5, :ten => 10}
hash.five #=> 5
hash.fifteen = 15
hash[:fifteen] #=> 15
This should work for any Ruby hash, both setting and getting values. For simplicity's sake, don't worry about supporting string keys, only symbols.
Refactoring
Similar Kata:
Stats:
Created | Nov 11, 2014 |
Published | Nov 11, 2014 |
Warriors Trained | 394 |
Total Skips | 64 |
Total Code Submissions | 413 |
Total Times Completed | 126 |
Ruby Completions | 125 |
Total Stars | 9 |
% of votes with a positive feedback rating | 89% of 36 |
Total "Very Satisfied" Votes | 30 |
Total "Somewhat Satisfied" Votes | 4 |
Total "Not Satisfied" Votes | 2 |