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

class WEBrick::HTTPUtils::FormData

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

要約

クライアントがフォームへ入力した値を表すクラスです。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? === __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 must_be must_be_close_to must_be_empty must_be_instance_of must_be_kind_of must_be_nil must_be_same_as must_be_within_epsilon must_equal must_include must_match must_raise must_respond_to must_send must_throw 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? respond_to_missing? singleton_class singleton_method_added singleton_method_removed singleton_method_undefined singleton_methods taint tainted? tap to_a to_hash to_int to_io to_proc to_regexp to_yaml to_yaml_properties to_yaml_style trust untaint untrust untrusted? wont_be wont_be_close_to wont_be_empty wont_be_instance_of wont_be_kind_of wont_be_nil wont_be_same_as wont_be_within_epsilon wont_equal wont_include wont_match wont_respond_to % * + << <=> =~ [] []= ascii_only? bytes bytesize capitalize capitalize! casecmp center chars chomp chomp! chop chop! chr clear codepoints count crypt delete delete! downcase downcase! dump each_line empty? encode encode! encoding end_with? eql? ext force_encoding gsub gsub! hash hex include? index insert inspect intern is_binary_data? is_complex_yaml? iseuc isjis issjis isutf8 kconv length ljust lstrip lstrip! match next next! oct ord partition pathmap pathmap_explode pathmap_partial pathmap_replace 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_r to_s toeuc tojis tolocale tosjis toutf16 toutf32 toutf8 tr tr! tr_s tr_s! unpack upcase upcase! upto valid_encoding? .try_convert