Sha256: 9b941a368998ca80a4acabb7a852f77bd9ee616e9d733aa17195c9a1e40897da

Contents?: true

Size: 452 Bytes

Versions: 3

Compression:

Stored size: 452 Bytes

Contents

require_relative 'base_inheritable'

module Grape
  module Util
    class InheritableValues < BaseInheritable
      def [](name)
        values[name]
      end

      def []=(name, value)
        new_values[name] = value
      end

      def merge(new_hash)
        values.merge!(new_hash)
      end

      def to_hash
        values
      end

      protected

      def values
        @inherited_values.merge(@new_values)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
grape-extra_validators-2.0.0 vendor/bundle/ruby/2.6.0/gems/grape-1.2.5/lib/grape/util/inheritable_values.rb
grape-extra_validators-1.0.0 vendor/bundle/ruby/2.4.0/gems/grape-1.2.5/lib/grape/util/inheritable_values.rb
grape-1.2.5 lib/grape/util/inheritable_values.rb