Module: Parts::Part

Included in:
EpiloguePart, FilePart, ParamPart
Defined in:
lib/tent-client/multipart-post/parts.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(boundary, name, value, options = {}) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/tent-client/multipart-post/parts.rb', line 7

def self.new(boundary, name, value, options = {})
  if value.respond_to?(:content_type)
    FilePart.new(boundary, name, value, options)
  else
    ParamPart.new(boundary, name, value, options)
  end
end

Instance Method Details

#lengthObject



15
16
17
# File 'lib/tent-client/multipart-post/parts.rb', line 15

def length
  @part.length
end

#to_ioObject



19
20
21
# File 'lib/tent-client/multipart-post/parts.rb', line 19

def to_io
  @io
end