rearmed-rb
rearmed-rb copied to clipboard
A collection of helpful methods and monkey patches for Arrays, Hash, Enumerables, Strings, Objects & Dates in Ruby
```ruby ################################################## CIString (Case-Insensitive String) - HELPFUL FOR STRING COMPARISONS WHERE WE NEED TO IGNORE CASE ERRORS class CIString < String def initialize(*args) if args[0].nil? args[0] = "" end super...
```ruby ################################################## CIHash (Case-Insensitive Hash) - HELPFUL FOR HASH KEY COMPARISONS WHERE WE NEED TO IGNORE CASE ERRORS class CIHash < HashWithIndifferentAccess def [](k) if self.has_key?(k) return super(k) else alt_key...
```ruby ################################################## SafeHash - ALL VALUE FETCHING OCCURS USING FETCH METHOD WHICH RAISES ERROR IF KEY NOT FOUND class SafeHash < HashWithIndifferentAccess def [](k) self.fetch(k) end end ```