Class: Reacto::Operations::Prepend

Inherits:
Object
  • Object
show all
Defined in:
lib/reacto/operations/prepend.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(enumerable) ⇒ Prepend

Returns a new instance of Prepend.



6
7
8
# File 'lib/reacto/operations/prepend.rb', line 6

def initialize(enumerable)
  @enumerable = enumerable
end

Instance Attribute Details

#enumerableObject (readonly)

Returns the value of attribute enumerable.



4
5
6
# File 'lib/reacto/operations/prepend.rb', line 4

def enumerable
  @enumerable
end

Instance Method Details

#call(tracker) ⇒ Object



10
11
12
13
# File 'lib/reacto/operations/prepend.rb', line 10

def call(tracker)
  enumerable.each { |value| tracker.on_value(value) }
  tracker
end