Class: Esse::Import::RequestBodyRaw
- Inherits:
-
RequestBody
- Object
- RequestBody
- Esse::Import::RequestBodyRaw
- Defined in:
- lib/esse/import/request_body.rb
Instance Attribute Summary
Attributes inherited from RequestBody
Instance Method Summary collapse
- #add(operation, payload) ⇒ Object
- #bytesize ⇒ Object
- #finalize ⇒ Object
-
#initialize ⇒ RequestBodyRaw
constructor
A new instance of RequestBodyRaw.
Methods inherited from RequestBody
Constructor Details
#initialize ⇒ RequestBodyRaw
Returns a new instance of RequestBodyRaw.
17 18 19 |
# File 'lib/esse/import/request_body.rb', line 17 def initialize super(body: '') end |
Instance Method Details
#add(operation, payload) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/esse/import/request_body.rb', line 25 def add(operation, payload) stats[operation] += 1 if @body.empty? @body = payload else @body << "\n" << payload end end |
#bytesize ⇒ Object
21 22 23 |
# File 'lib/esse/import/request_body.rb', line 21 def bytesize body.bytesize end |
#finalize ⇒ Object
34 35 36 |
# File 'lib/esse/import/request_body.rb', line 34 def finalize @body << "\n" end |