Class: Coolio::Http::Payload::Streamed

Inherits:
Base
  • Object
show all
Defined in:
lib/cool.io/http/payload.rb

Instance Method Summary collapse

Methods inherited from Base

#close, #flatten_params, #flatten_params_array, #headers, #initialize, #inspect, #read, #short_inspect

Constructor Details

This class inherits a constructor from Coolio::Http::Payload::Base

Instance Method Details

#build_stream(params = nil) ⇒ Object



128
129
130
# File 'lib/cool.io/http/payload.rb', line 128

def build_stream(params = nil)
  @stream = params
end

#sizeObject Also known as: length



132
133
134
135
136
137
138
# File 'lib/cool.io/http/payload.rb', line 132

def size
  if @stream.respond_to?(:size)
    @stream.size
  elsif @stream.is_a?(IO)
    @stream.stat.size
  end
end