Class: Grape::Util::Lazy::ValueHash
- Inherits:
-
ValueEnumerable
- Object
- Value
- ValueEnumerable
- Grape::Util::Lazy::ValueHash
- Defined in:
- lib/grape/util/lazy/value_hash.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(hash) ⇒ ValueHash
constructor
A new instance of ValueHash.
Methods inherited from ValueEnumerable
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
#evaluate ⇒ Object
15 16 17 |
# File 'lib/grape/util/lazy/value_hash.rb', line 15 def evaluate @value_hash.transform_values(&:evaluate) end |