Class: Familia::Validation::CommandRecorder::PipelineBlock
- Inherits:
-
Object
- Object
- Familia::Validation::CommandRecorder::PipelineBlock
- Defined in:
- lib/familia/validation/command_recorder.rb
Overview
Represents a pipeline block
Instance Attribute Summary collapse
-
#commands ⇒ Object
readonly
Returns the value of attribute commands.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
Instance Method Summary collapse
-
#command_count ⇒ Object
-
#finalize(all_commands) ⇒ Object
-
#initialize(context = {}) ⇒ PipelineBlock
constructor
A new instance of PipelineBlock.
Constructor Details
#initialize(context = {}) ⇒ PipelineBlock
Returns a new instance of PipelineBlock.
205 206 207 208 209 |
# File 'lib/familia/validation/command_recorder.rb', line 205 def initialize(context = {}) @context = context @started_at = Time.now @commands = [] end |
Instance Attribute Details
#commands ⇒ Object (readonly)
Returns the value of attribute commands.
203 204 205 |
# File 'lib/familia/validation/command_recorder.rb', line 203 def commands @commands end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
203 204 205 |
# File 'lib/familia/validation/command_recorder.rb', line 203 def context @context end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
203 204 205 |
# File 'lib/familia/validation/command_recorder.rb', line 203 def started_at @started_at end |
Instance Method Details
#command_count ⇒ Object
216 217 218 |
# File 'lib/familia/validation/command_recorder.rb', line 216 def command_count @commands.length end |
#finalize(all_commands) ⇒ Object
211 212 213 214 |
# File 'lib/familia/validation/command_recorder.rb', line 211 def finalize(all_commands) # Pipeline commands are those executed within pipeline context @commands = all_commands.select(&:pipeline_command?) end |