| Class | WEBrick::HTTPUtils::FormData |
| In: |
webrick/httputils.rb
|
| Parent: | String |
| EmptyRawHeader | = | [].freeze |
| EmptyHeader | = | {}.freeze |
| filename | [RW] | |
| name | [RW] | |
| next_data | [RW] |
# File webrick/httputils.rb, line 218 def initialize(*args) @name = @filename = @next_data = nil if args.empty? @raw_header = [] @header = nil super("") else @raw_header = EmptyRawHeader @header = EmptyHeader super(args.shift) unless args.empty? @next_data = self.class.new(*args) end end end
# File webrick/httputils.rb, line 242 def <<(str) if @header super elsif str == CRLF @header = HTTPUtils::parse_header(@raw_header) if cd = self['content-disposition'] if /\s+name="(.*?)"/ =~ cd then @name = $1 end if /\s+filename="(.*?)"/ =~ cd then @filename = $1 end end else @raw_header << str end self end
# File webrick/httputils.rb, line 234 def [](*key) begin @header[key[0].downcase].join(", ") rescue StandardError, NameError super end end
# File webrick/httputils.rb, line 257 def append_data(data) tmp = self while tmp unless tmp.next_data tmp.next_data = data break end tmp = tmp.next_data end self end
# File webrick/httputils.rb, line 269 def each_data tmp = self while tmp next_data = tmp.next_data yield(tmp) tmp = next_data end end
ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.