Class: FeatureEnvy::Operation::Pipeline
- Inherits:
-
Object
- Object
- FeatureEnvy::Operation::Pipeline
- Defined in:
- lib/feature_envy/operation.rb
Instance Method Summary collapse
- #call(value) ⇒ Object
-
#initialize(first, second) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #inspect ⇒ Object
Constructor Details
#initialize(first, second) ⇒ Pipeline
Returns a new instance of Pipeline.
17 18 19 20 21 22 |
# File 'lib/feature_envy/operation.rb', line 17 def initialize first, second first_operations = first.is_a?(Pipeline) ? first.operations : [first] second_operations = second.is_a?(Pipeline) ? second.operations : [second] @operations = first_operations + second_operations end |
Instance Method Details
#call(value) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/feature_envy/operation.rb', line 24 def call value @operations.each do |operation| value = operation.call value end value end |
#inspect ⇒ Object
32 33 34 |
# File 'lib/feature_envy/operation.rb', line 32 def inspect @operations.map(&:inspect).join " >> " end |