Class: Traject::Indexer::LastNamedStep
- Inherits:
-
Object
- Object
- Traject::Indexer::LastNamedStep
- Defined in:
- lib/traject/indexer.rb
Overview
A convenient way to find, and generate error messages for, the last named step (for helping locate parse errors)
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#step ⇒ Object
Returns the value of attribute step.
Instance Method Summary collapse
-
#initialize(index_steps) ⇒ LastNamedStep
constructor
Get the last step for which we have a field_name (e.g., the last to_field, skipping over each_record).
Constructor Details
#initialize(index_steps) ⇒ LastNamedStep
Get the last step for which we have a field_name (e.g., the last to_field, skipping over each_record)
462 463 464 465 466 467 468 469 |
# File 'lib/traject/indexer.rb', line 462 def initialize(index_steps) @step = index_steps.reverse_each.find{|step| step[:field_name]} if @step @message = "last successfully parsed field was '#{@step[:field_name]}'" else @message = "there were no previous named fields successfully parsed" end end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
459 460 461 |
# File 'lib/traject/indexer.rb', line 459 def @message end |
#step ⇒ Object
Returns the value of attribute step.
459 460 461 |
# File 'lib/traject/indexer.rb', line 459 def step @step end |