Class: Grape::Util::Lazy::ValueArray
Instance Attribute Summary
Attributes inherited from Value
#access_keys
Instance Method Summary
collapse
#[], #[]=, #fetch
Methods inherited from Value
#evaluate_from, #reached_by
Methods inherited from Base
#to_s
Constructor Details
#initialize(array) ⇒ ValueArray
7
8
9
10
11
12
13
|
# File 'lib/grape/util/lazy/value_array.rb', line 7
def initialize(array)
super
@value_hash = []
array.each_with_index do |value, index|
self[index] = value
end
end
|
Instance Method Details
#evaluate ⇒ Object
15
16
17
|
# File 'lib/grape/util/lazy/value_array.rb', line 15
def evaluate
@value_hash.map(&:evaluate)
end
|