Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > webrick/httputilsライブラリ > WEBrick::HTTPUtils::FormDataクラス

class WEBrick::HTTPUtils::FormData

クラスの継承リスト: WEBrick::HTTPUtils::FormData < String < Enumerable < Comparable < Object < Kernel

要約

クライアントがフォームへ入力した値を表すクラスです。multipart/form-data なデータを表すのにも 使われます。

WEBrick::HTTPRequest#query はリクエストのクエリーあるいは クライアントがフォームへ入力した値を保持した Hash を返しますが、 その Hash のキーと値のうち値は FormData クラスのインスタンスになります。 同じ名前のフィールドが複数ある場合、WEBrick::HTTPUtils::FormData#listWEBrick::HTTPUtils::FormData#each_data によりそれぞれの値を取り出すことができます。

通常のフォームデータ(application/x-www-form-urlencoded)は unescape されています。 ただし multipart/form-data なフォームデータはユーザが content-transfer-encoding ヘッダを見て適切に処理する必要があります。

リンク

特異メソッド

定義 説明
new(*args) -> WEBrick::HTTPUtils::FormData

WEBrick::HTTPUtils の内部で使われます。ユーザがこのメソッドを直接呼ぶことはありません。

インスタンスメソッド

定義 説明
self << str -> self

WEBrick::HTTPUtils の内部で使われます。ユーザがこのメソッドを直接呼ぶことはありません。

self[header] -> String | nil

自身が multipart/form-data なデータの場合に、header で指定された ヘッダの値を文字列で返します。無ければ nil を返します。

append_data(data) -> self

WEBrick::HTTPUtils の内部で使われます。ユーザがこのメソッドを直接呼ぶことはありません。

each_data {|s| ... }

自身が表す各フォームデータを引数として、与えられたブロックを実行します。

filename -> String | nil
filename=(value)

フォームデータの filename 属性を文字列で表すアクセサです。

list -> Array
to_ary -> Array

自身が表す各フォームデータを収納した配列を生成して返します。

name -> String | nil
name=(value)

フォームデータの name 属性を文字列で表すアクセサです。

to_s -> String

自身が表すフォームデータのうちのひとつを文字列として返します。

継承したメソッド

< <= == > >= between? all? any? collect count cycle detect drop drop_while each_cons each_slice each_with_index entries find_all find_index first grep group_by include? inject max max_by min min_by minmax minmax_by none? one? partition reject reverse_each sort sort_by take take_while to_set zip === __id__ __send__ _dump class clone dclone display enum_for equal? extend freeze frozen? initialize initialize_copy instance_eval instance_exec instance_of? instance_variable_defined? instance_variable_get instance_variable_set instance_variables is_a? marshal_dump marshal_load method method_missing methods nil? pretty_inspect pretty_print pretty_print_cycle pretty_print_inspect pretty_print_instance_variables private_methods protected_methods public_methods remove_instance_variable respond_to? singleton_method_added singleton_method_removed singleton_method_undefined singleton_methods taint tainted? tap to_hash to_int to_io to_proc to_regexp to_yaml to_yaml_properties to_yaml_style untaint % * + << <=> =~ [] []= bytes bytesize capitalize capitalize! casecmp center chars chomp chomp! chop chop! crypt delete delete! downcase downcase! dump each empty? end_with? eql? gsub gsub! hash hex index insert inspect intern is_binary_data? is_complex_yaml? iseuc issjis isutf8 jcount jlength kconv length ljust lstrip lstrip! match mbchar? next next! oct replace reverse reverse! rindex rjust rpartition rstrip rstrip! scan scanf shellescape shellsplit slice! split squeeze squeeze! start_with? strip strip! sub sub! sum swapcase swapcase! to_d to_f to_i to_ptr to_s toeuc tojis tosjis toutf16 toutf8 tr tr! tr_s tr_s! unpack upcase upcase! upto