Class: Faraday::CompositeReadIO

Inherits:
CompositeReadIO
  • Object
show all
Defined in:
lib/faraday/upload_io.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parts) ⇒ CompositeReadIO



14
15
16
17
18
# File 'lib/faraday/upload_io.rb', line 14

def initialize(parts)
  @length = parts.inject(0) { |sum, part| sum + part.length }
  ios = parts.map{ |part| part.to_io }
  super(*ios)
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length



12
13
14
# File 'lib/faraday/upload_io.rb', line 12

def length
  @length
end