Class: Yarrow::Process::StepProcessor
- Inherits:
-
Object
- Object
- Yarrow::Process::StepProcessor
show all
- Defined in:
- lib/yarrow/process/step_processor.rb
Class Attribute Summary collapse
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of StepProcessor.
18
19
20
|
# File 'lib/yarrow/process/step_processor.rb', line 18
def initialize
@source = nil
end
|
Class Attribute Details
Returns the value of attribute accepted_input.
7
8
9
|
# File 'lib/yarrow/process/step_processor.rb', line 7
def accepted_input
@accepted_input
end
|
.provided_output ⇒ Object
Returns the value of attribute provided_output.
7
8
9
|
# File 'lib/yarrow/process/step_processor.rb', line 7
def provided_output
@provided_output
end
|
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
4
5
6
|
# File 'lib/yarrow/process/step_processor.rb', line 4
def source
@source
end
|
Class Method Details
.accepts(input_const) ⇒ Object
9
10
11
|
# File 'lib/yarrow/process/step_processor.rb', line 9
def accepts(input_const)
@accepted_input = input_const.to_s
end
|
.provides(output_const) ⇒ Object
13
14
15
|
# File 'lib/yarrow/process/step_processor.rb', line 13
def provides(output_const)
@provided_output = output_const.to_s
end
|
Instance Method Details
#accepts ⇒ Object
22
23
24
|
# File 'lib/yarrow/process/step_processor.rb', line 22
def accepts
self.class.accepted_input
end
|
#can_accept?(provided) ⇒ Boolean
30
31
32
|
# File 'lib/yarrow/process/step_processor.rb', line 30
def can_accept?(provided)
accepts == provided
end
|
#process(source) ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/yarrow/process/step_processor.rb', line 34
def process(source)
result = step(source)
result
end
|
#provides ⇒ Object
26
27
28
|
# File 'lib/yarrow/process/step_processor.rb', line 26
def provides
self.class.provided_output
end
|