Method: Streamer::Functors::Subtract#subtract
- Defined in:
- lib/streamer/functors/subtract.rb
#subtract ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/streamer/functors/subtract.rb', line 9 def subtract terms = .fetch(:terms) initial_prop = terms.shift terms.inject(prop(initial_prop).to_f) do |total, item| total - prop(item).to_f end end |