Class: Parts::ParamPart

### Home Classes Methods

### In Files

- lib/parts.rb

### Parent

Object

### Methods

- ::new
- #build_part
- #length

### Class/Module Index

Quicksearch

- Net
- Net::HTTP
- Net::HTTP::Post
- Net::HTTP::Post::Multipart
- Net::HTTP::Put
- Net::HTTP::Put::Multipart
- Parts
- Parts::EpiloguePart
- Parts::FilePart
- Parts::ParamPart
- CompositeReadIO
- MultipartPost
- Multipartable
- UploadIO

No matching classes.

# Parts::ParamPart

### Public Class Methods

new(boundary, name, value, headers = {}) click to toggle source

    # File lib/parts.rb, line 33
    def initialize(boundary, name, value, headers = {})
      @part = build_part(boundary, name, value, headers)
      @io = StringIO.new(@part)
    end

### Public Instance Methods

build_part(boundary, name, value, headers = {}) click to toggle source

    # File lib/parts.rb, line 42
    def build_part(boundary, name, value, headers = {})
      part = ''
      part << "--#{boundary}\r\n"
      part << "Content-Disposition: form-data; name=\"#{name.to_s}\"\r\n"
      part << "Content-Type: #{headers["Content-Type"]}\r\n" if headers["Content-Type"]
      part << "\r\n"
      part << "#{value}\r\n"
    end

length() click to toggle source

    # File lib/parts.rb, line 38
    def length
     @part.bytesize
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.