Sha256: 4b024050beeb514b844cc57f18e8f244f3b8342f4852d5d1e819f00eaad1a665

Contents?: true

Size: 446 Bytes

Versions: 5

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

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

5 entries across 5 versions & 1 rubygems

Version Path
grape-2.2.0 lib/grape/util/inheritable_values.rb
grape-2.1.3 lib/grape/util/inheritable_values.rb
grape-2.1.2 lib/grape/util/inheritable_values.rb
grape-2.1.1 lib/grape/util/inheritable_values.rb
grape-2.1.0 lib/grape/util/inheritable_values.rb