Class: Traject::Indexer::Context
- Inherits:
-
Object
- Object
- Traject::Indexer::Context
- Defined in:
- lib/traject/indexer.rb
Overview
Represents the context of a specific record being indexed, passed to indexing logic blocks
Instance Attribute Summary collapse
-
#clipboard ⇒ Object
Returns the value of attribute clipboard.
-
#index_step ⇒ Object
Returns the value of attribute index_step.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#output_hash ⇒ Object
Returns the value of attribute output_hash.
-
#position ⇒ Object
1-based position in stream of processed records.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#skipmessage ⇒ Object
Should we be skipping this record?.
-
#source_record ⇒ Object
Returns the value of attribute source_record.
Instance Method Summary collapse
-
#initialize(hash_init = {}) ⇒ Context
constructor
A new instance of Context.
-
#skip!(msg = '(no message given)') ⇒ Object
Set the fact that this record should be skipped, with an optional message.
-
#skip? ⇒ Boolean
Should we skip this record?.
Constructor Details
#initialize(hash_init = {}) ⇒ Context
Returns a new instance of Context.
437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/traject/indexer.rb', line 437 def initialize(hash_init = {}) # TODO, argument checking for required args? self.clipboard = {} self.output_hash = {} hash_init.each_pair do |key, value| self.send("#{key}=", value) end @skip = false end |
Instance Attribute Details
#clipboard ⇒ Object
Returns the value of attribute clipboard.
450 451 452 |
# File 'lib/traject/indexer.rb', line 450 def clipboard @clipboard end |
#index_step ⇒ Object
Returns the value of attribute index_step.
451 452 453 |
# File 'lib/traject/indexer.rb', line 451 def index_step @index_step end |
#logger ⇒ Object
Returns the value of attribute logger.
450 451 452 |
# File 'lib/traject/indexer.rb', line 450 def logger @logger end |
#output_hash ⇒ Object
Returns the value of attribute output_hash.
450 451 452 |
# File 'lib/traject/indexer.rb', line 450 def output_hash @output_hash end |
#position ⇒ Object
1-based position in stream of processed records.
453 454 455 |
# File 'lib/traject/indexer.rb', line 453 def position @position end |
#settings ⇒ Object
Returns the value of attribute settings.
451 452 453 |
# File 'lib/traject/indexer.rb', line 451 def settings @settings end |
#skipmessage ⇒ Object
Should we be skipping this record?
456 457 458 |
# File 'lib/traject/indexer.rb', line 456 def end |
#source_record ⇒ Object
Returns the value of attribute source_record.
451 452 453 |
# File 'lib/traject/indexer.rb', line 451 def source_record @source_record end |
Instance Method Details
#skip!(msg = '(no message given)') ⇒ Object
Set the fact that this record should be skipped, with an optional message
460 461 462 463 |
# File 'lib/traject/indexer.rb', line 460 def skip!(msg = '(no message given)') = msg @skip = true end |
#skip? ⇒ Boolean
Should we skip this record?
466 467 468 |
# File 'lib/traject/indexer.rb', line 466 def skip? @skip end |