Class: Grape::Util::Lazy::ValueHash

Inherits:
ValueEnumerable show all
Defined in:
lib/grape/util/lazy/value_hash.rb

Direct Known Subclasses

EndpointConfiguration

Instance Attribute Summary

Attributes inherited from Value

#access_keys

Instance Method Summary collapse

Methods inherited from ValueEnumerable

#[], #[]=, #fetch

Methods inherited from Value

#evaluate_from, #lazy?, #reached_by, #to_s

Constructor Details

#initialize(hash) ⇒ ValueHash

Returns a new instance of ValueHash.



7
8
9
10
11
12
13
# File 'lib/grape/util/lazy/value_hash.rb', line 7

def initialize(hash)
  super
  @value_hash = ActiveSupport::HashWithIndifferentAccess.new
  hash.each do |key, value|
    self[key] = value
  end
end

Instance Method Details

#evaluateObject



15
16
17
# File 'lib/grape/util/lazy/value_hash.rb', line 15

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