Class: HTTPX::Transcoder::Body::Encoder
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- HTTPX::Transcoder::Body::Encoder
- Defined in:
- lib/httpx/transcoder/body.rb,
sig/transcoder/body.rbs
Instance Method Summary collapse
Instance Method Details
#bytesize ⇒ Integer, Float
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/httpx/transcoder/body.rb', line 18 def bytesize if @body.respond_to?(:bytesize) @body.bytesize elsif @body.respond_to?(:to_ary) @body.sum(&:bytesize) elsif @body.respond_to?(:size) @body.size || Float::INFINITY elsif @body.respond_to?(:length) @body.length || Float::INFINITY elsif @body.respond_to?(:each) Float::INFINITY else raise Error, "cannot determine size of body: #{@body.inspect}" end end |
#content_type ⇒ String
34 35 36 |
# File 'lib/httpx/transcoder/body.rb', line 34 def content_type "application/octet-stream" end |
#to_s ⇒ String
14 |
# File 'sig/transcoder/body.rbs', line 14
def to_s: () -> String
|