Class: Grape::Util::LazyValueHash
- Inherits:
-
LazyValueEnumerable
- Object
- LazyValue
- LazyValueEnumerable
- Grape::Util::LazyValueHash
- Defined in:
- lib/grape/util/lazy_value.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from LazyValue
Instance Method Summary collapse
- #evaluate ⇒ Object
-
#initialize(hash) ⇒ LazyValueHash
constructor
A new instance of LazyValueHash.
Methods inherited from LazyValueEnumerable
Methods inherited from LazyValue
#evaluate_from, #lazy?, #reached_by, #to_s
Constructor Details
#initialize(hash) ⇒ LazyValueHash
Returns a new instance of LazyValueHash.
78 79 80 81 82 83 84 |
# File 'lib/grape/util/lazy_value.rb', line 78 def initialize(hash) super @value_hash = ActiveSupport::HashWithIndifferentAccess.new hash.each do |key, value| self[key] = value end end |
Instance Method Details
#evaluate ⇒ Object
86 87 88 |
# File 'lib/grape/util/lazy_value.rb', line 86 def evaluate @value_hash.transform_values(&:evaluate) end |