Class: Familia::Validation::CommandRecorder::PipelineBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/familia/validation/command_recorder.rb

Overview

Represents a pipeline block

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commandsObject (readonly)

Returns the value of attribute commands.



203
204
205
# File 'lib/familia/validation/command_recorder.rb', line 203

def commands
  @commands
end

#contextObject (readonly)

Returns the value of attribute context.



203
204
205
# File 'lib/familia/validation/command_recorder.rb', line 203

def context
  @context
end

#started_atObject (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_countObject



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