Sha256: da43eda5cdc4d9fc292c657e626cd1359063a92cad330e1d77bc69d68922a98d

Contents?: true

Size: 459 Bytes

Versions: 13

Compression:

Stored size: 459 Bytes

Contents

module Figleaf
  class Fighash < Hashie::Mash
    def method_missing(method_name, *args, &blk)
      return super if key?(method_name)
      case method_name
      when /.*?[?=!]$/
        super(method_name, *args, &blk)
      else
        raise NoMethodError
      end
    end

    def to_hash
      super.tap do |hash|
        keys = hash.keys
        keys.each do |key|
          hash[key.to_sym] = hash.delete(key)
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
figleaf-0.3.1 lib/figleaf/fighash.rb
figleaf-0.3.0 lib/figleaf/fighash.rb
figleaf-0.2.9 lib/figleaf/fighash.rb
figleaf-0.2.7 lib/figleaf/fighash.rb
figleaf-0.2.6 lib/figleaf/fighash.rb
figleaf-0.2.5 lib/figleaf/fighash.rb
figleaf-0.2.4 lib/figleaf/fighash.rb
figleaf-0.2.3 lib/figleaf/fighash.rb
figleaf-0.2.2 lib/figleaf/fighash.rb
figleaf-0.2.1 lib/figleaf/fighash.rb
figleaf-0.2.0 lib/figleaf/fighash.rb
figleaf-0.0.7 lib/figleaf/fighash.rb
figleaf-0.0.6 lib/figleaf/fighash.rb