Class: Traject::Indexer::AfterProcessingStep

Inherits:
Object
  • Object
show all
Defined in:
lib/traject/indexer/step.rb

Overview

A class representing a block of logic called after processing, registered with #after_processing

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lambda, block, source_location) ⇒ AfterProcessingStep

Returns a new instance of AfterProcessingStep.



180
181
182
183
184
# File 'lib/traject/indexer/step.rb', line 180

def initialize(lambda, block, source_location)
  self.lambda          = lambda
  self.block           = block
  self.source_location = source_location
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



178
179
180
# File 'lib/traject/indexer/step.rb', line 178

def block
  @block
end

#lambdaObject

Returns the value of attribute lambda.



178
179
180
# File 'lib/traject/indexer/step.rb', line 178

def lambda
  @lambda
end

#source_locationObject

Returns the value of attribute source_location.



178
179
180
# File 'lib/traject/indexer/step.rb', line 178

def source_location
  @source_location
end

Instance Method Details

#executeObject

after_processing steps get no args yielded to their blocks, they just are what they are.



193
194
195
196
# File 'lib/traject/indexer/step.rb', line 193

def execute
  @block.call if @block
  @lambda.call if @lambda
end

#inspectObject



198
199
200
# File 'lib/traject/indexer/step.rb', line 198

def inspect
  "(after_processing at #{self.source_location}"
end

#to_field_step?Boolean

Returns:

  • (Boolean)


187
188
189
# File 'lib/traject/indexer/step.rb', line 187

def to_field_step?
  false
end