Sha256: 446ef63e7f00221fc2fb4e1dca942aeac8bf62d8bd4d9cb861da9be240148268

Contents?: true

Size: 250 Bytes

Versions: 15

Compression:

Stored size: 250 Bytes

Contents

module Carload
  class ExtendedHash < Hash
    def method_missing method, *args, &block
      key = method.to_s.gsub('=', '').to_sym
      if method.to_s =~ /=$/
        self[key] = args.first
      else
        self[key]
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
carload-0.5.3 lib/carload/extended_hash.rb
carload-0.5.2 lib/carload/extended_hash.rb
carload-0.5.1 lib/carload/extended_hash.rb
carload-0.5.0 lib/carload/extended_hash.rb
carload-0.4.5 lib/carload/extended_hash.rb
carload-0.4.4 lib/carload/extended_hash.rb
carload-0.4.3 lib/carload/extended_hash.rb
carload-0.4.2 lib/carload/extended_hash.rb
carload-0.4.1 lib/carload/extended_hash.rb
carload-0.4.0 lib/carload/extended_hash.rb
carload-0.3.0 lib/carload/extended_hash.rb
carload-0.2.2 lib/carload/extended_hash.rb
carload-0.2.1 lib/carload/extended_hash.rb
carload-0.2.0 lib/carload/extended_hash.rb
carload-0.1.0 lib/carload/extended_hash.rb