Class: Array
- Inherits:
-
Object
show all
- Includes:
- ReactiveTags
- Defined in:
- lib/volt/extra_core/array.rb,
lib/volt/extra_core/blank.rb,
lib/volt/reactive/array_extensions.rb
Instance Method Summary
collapse
included, #reactive_method_tag
Instance Method Details
5
6
7
8
9
10
11
12
|
# File 'lib/volt/reactive/array_extensions.rb', line 5
def +(val)
result = __old_plus(val.cur)
if val.reactive? && !result.reactive?
result = ReactiveValue.new(result)
end
return result
end
|
#__old_plus ⇒ Object
3
|
# File 'lib/volt/reactive/array_extensions.rb', line 3
alias :__old_plus :+
|
11
12
13
14
15
16
17
18
|
# File 'lib/volt/extra_core/array.rb', line 11
def deep_cur
new_array = []
each do |item|
new_array << item.deep_cur
end
return new_array
end
|
2
3
4
5
6
7
8
9
|
# File 'lib/volt/extra_core/array.rb', line 2
def sum
total = 0
self.each do |val|
total += val
end
return total
end
|