Module: Parts::Part

Included in:
EpiloguePart, FilePart, ParamPart
Defined in:
lib/parts.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new(boundary, name, value) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/parts.rb', line 9

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

Instance Method Details

#lengthObject



17
18
19
# File 'lib/parts.rb', line 17

def length
  @part.length
end

#to_ioObject



21
22
23
# File 'lib/parts.rb', line 21

def to_io
  @io
end