Class: RestClient::Payload::Streamed
- Inherits:
-
Base
- Object
- Base
- RestClient::Payload::Streamed
- Defined in:
- lib/restclient/payload.rb
Instance Method Summary (collapse)
- - (Object) build_stream(params = nil)
- - (Object) size (also: #length)
Methods inherited from Base
#close, #flatten_params, #flatten_params_array, #headers, #initialize, #inspect, #read, #short_inspect
Constructor Details
This class inherits a constructor from RestClient::Payload::Base
Instance Method Details
- (Object) build_stream(params = nil)
125 126 127 |
# File 'lib/restclient/payload.rb', line 125 def build_stream(params = nil) @stream = params end |
- (Object) size Also known as: length
129 130 131 132 133 134 135 |
# File 'lib/restclient/payload.rb', line 129 def size if @stream.respond_to?(:size) @stream.size elsif @stream.is_a?(IO) @stream.stat.size end end |