module Parts::Part
Public Class Methods
file?(value)
click to toggle source
# File lib/parts.rb, line 18 def self.file?(value) value.respond_to?(:content_type) && value.respond_to?(:original_filename) end
new(boundary, name, value, headers = {})
click to toggle source
# File lib/parts.rb, line 9 def self.new(boundary, name, value, headers = {}) headers ||= {} # avoid nil values if file?(value) FilePart.new(boundary, name, value, headers) else ParamPart.new(boundary, name, value, headers) end end
Public Instance Methods
length()
click to toggle source
# File lib/parts.rb, line 22 def length @part.length end
to_io()
click to toggle source
# File lib/parts.rb, line 26 def to_io @io end