Class: Docusigner::Multipart::Parts::DocumentPart

Inherits:
Object
  • Object
show all
Defined in:
lib/docusigner/multipart.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(boundary, upload_io, opts = {}) ⇒ DocumentPart

Returns a new instance of DocumentPart.



62
63
64
65
66
67
68
# File 'lib/docusigner/multipart.rb', line 62

def initialize(boundary, upload_io, opts = {})
  @upload_io = upload_io
  head = build(boundary, @upload_io, opts)
  foot = "\r\n"
  @output_io = CompositeReadIO.new(StringIO.new(head), @upload_io.io, StringIO.new(foot))
  @length = head.length + file_length + foot.length
end

Instance Attribute Details

#lengthObject (readonly)

Returns the value of attribute length.



61
62
63
# File 'lib/docusigner/multipart.rb', line 61

def length
  @length
end

Instance Method Details

#to_ioObject



69
70
71
# File 'lib/docusigner/multipart.rb', line 69

def to_io
  @output_io
end