Class: Esse::Import::RequestBodyAsJson

Inherits:
RequestBody show all
Defined in:
lib/esse/import/request_body.rb

Instance Attribute Summary

Attributes inherited from RequestBody

#body, #stats

Instance Method Summary collapse

Methods inherited from RequestBody

#body?

Constructor Details

#initializeRequestBodyAsJson

Returns a new instance of RequestBodyAsJson.



40
41
42
# File 'lib/esse/import/request_body.rb', line 40

def initialize
  super(body: [])
end

Instance Method Details

#create=(docs) ⇒ Object



54
55
56
57
# File 'lib/esse/import/request_body.rb', line 54

def create=(docs)
  @body += docs
  @stats[:create] += docs.size
end

#delete=(docs) ⇒ Object



59
60
61
62
# File 'lib/esse/import/request_body.rb', line 59

def delete=(docs)
  @body += docs
  @stats[:delete] += docs.size
end

#index=(docs) ⇒ Object



44
45
46
47
# File 'lib/esse/import/request_body.rb', line 44

def index=(docs)
  @body += docs
  @stats[:index] += docs.size
end

#update=(docs) ⇒ Object



49
50
51
52
# File 'lib/esse/import/request_body.rb', line 49

def update=(docs)
  @body += docs
  @stats[:update] += docs.size
end