Sha256: 58db99525b99c1db9832c2869225d7edb3d33d1a81f8de7b0c0effdbfa43a9c7

Contents?: true

Size: 471 Bytes

Versions: 34

Compression:

Stored size: 471 Bytes

Contents

module Stove
  class Mash < ::Hash
    def method_missing(m, *args, &block)
      if has_key?(m.to_sym)
        self[m.to_sym]
      elsif has_key?(m.to_s)
        self[m.to_s]
      else
        super
      end
    end

    def methods(include_private = false)
      super + self.keys.map(&:to_sym)
    end

    def respond_to?(m, include_private = false)
      if has_key?(m.to_sym) || has_key?(m.to_s)
        true
      else
        super
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 3 rubygems

Version Path
chef-stove-7.1.6 lib/stove/mash.rb
stove-7.1.6 lib/stove/mash.rb
chef-stove-7.1.5 lib/stove/mash.rb
stove-7.1.5 lib/stove/mash.rb
chef-stove-7.1.1 lib/stove/mash.rb
stove-7.1.0 lib/stove/mash.rb
stove-7.0.1 lib/stove/mash.rb
stove-7.0.0 lib/stove/mash.rb
stove-6.1.1 lib/stove/mash.rb
stove-6.1.0 lib/stove/mash.rb
stove-6.0.0 lib/stove/mash.rb
stove-5.2.0 lib/stove/mash.rb
stove-5.1.0 lib/stove/mash.rb
stove-5.0.0 lib/stove/mash.rb
stove-4.1.1 lib/stove/mash.rb
stove-4.1.0 lib/stove/mash.rb
stove-4.0.0 lib/stove/mash.rb
stove-3.2.8 lib/stove/mash.rb
wood-stove-3.2.9000 lib/stove/mash.rb
stove-3.2.7 lib/stove/mash.rb