Class: Chewy::Type::Import::JournalBuilder
- Defined in:
- lib/chewy/type/import/journal_builder.rb
Instance Method Summary collapse
- #bulk_body ⇒ Object
-
#initialize(type, index: [], delete: []) ⇒ JournalBuilder
constructor
A new instance of JournalBuilder.
Constructor Details
#initialize(type, index: [], delete: []) ⇒ JournalBuilder
Returns a new instance of JournalBuilder.
5 6 7 8 9 |
# File 'lib/chewy/type/import/journal_builder.rb', line 5 def initialize(type, index: [], delete: []) @type = type @index = index @delete = delete end |
Instance Method Details
#bulk_body ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/chewy/type/import/journal_builder.rb', line 11 def bulk_body Chewy::Type::Import::BulkBuilder.new( Chewy::Stash::Journal::Journal, index: [ entries(:index, @index), entries(:delete, @delete) ].compact ).bulk_body.each do |item| item.values.first.merge!( _index: Chewy::Stash::Journal.index_name, _type: Chewy::Stash::Journal::Journal.type_name ) end end |