Module: SolrMakr::BufferInteraction
- Extended by:
- ActiveSupport::Concern
- Included in:
- Commands::AbstractCommand, Commands::Execute
- Defined in:
- lib/solr_makr/meta/buffer_interaction.rb
Instance Attribute Summary collapse
- #buffer ⇒ SolrMakr::Commands::Buffer readonly
Instance Method Summary collapse
- #build_buffer ⇒ Object
- #compose_buffer(other, raise_interrupt: true, **options, &on_failure) ⇒ Object
Instance Attribute Details
#buffer ⇒ SolrMakr::Commands::Buffer (readonly)
7 8 9 |
# File 'lib/solr_makr/meta/buffer_interaction.rb', line 7 attr_lazy_reader :buffer do build_buffer end |
Instance Method Details
#build_buffer ⇒ Object
37 38 39 |
# File 'lib/solr_makr/meta/buffer_interaction.rb', line 37 def build_buffer SolrMakr::Commands::Buffer.new end |
#compose_buffer(other, raise_interrupt: true, **options, &on_failure) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/solr_makr/meta/buffer_interaction.rb', line 15 def compose_buffer(other, raise_interrupt: true, **, &on_failure) outcome = other.run(**) if outcome.kind_of?(SolrMakr::BufferInteraction) buffer.import outcome.buffer end if outcome.valid? return outcome.result else if block_given? yield outcome end if raise_interrupt throw :interrupt, outcome.errors end return nil end end |