Sha256: 94eb120f63cc2986a8639f7383a8666d322324cae726ea1fb285ecd5219e3b7c

Contents?: true

Size: 433 Bytes

Versions: 5

Compression:

Stored size: 433 Bytes

Contents

# frozen_string_literal: true

module Grape
  module Util
    module Lazy
      class ValueHash < ValueEnumerable
        def initialize(hash)
          super
          @value_hash = ActiveSupport::HashWithIndifferentAccess.new
          hash.each do |key, value|
            self[key] = value
          end
        end

        def evaluate
          @value_hash.transform_values(&:evaluate)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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