Class: Yarrow::Process::StepProcessor

Inherits:
Object
  • Object
show all
Defined in:
lib/yarrow/process/step_processor.rb

Direct Known Subclasses

ExpandContent, ExtractSource, ProjectManifest

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStepProcessor

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

.accepted_inputObject (readonly)

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_outputObject (readonly)

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

#sourceObject (readonly)

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

#acceptsObject



22
23
24
# File 'lib/yarrow/process/step_processor.rb', line 22

def accepts
  self.class.accepted_input
end

#can_accept?(provided) ⇒ Boolean

Returns:

  • (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)
  # begin
  result = step(source)
  # log.info("<Result source=#{result}>")
  # rescue
  result
end

#providesObject



26
27
28
# File 'lib/yarrow/process/step_processor.rb', line 26

def provides
  self.class.provided_output
end