るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.129秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:status=[x]

別のキーワード

  1. _builtin to_h
  2. hash to_h
  3. struct to_h
  4. env to_h
  5. array to_h

ライブラリ

クラス

モジュール

キーワード

検索結果

WEBrick::HTTPResponse#status=(status) (24106.0)

レスポンスのステータスコードを整数で指定します。 reason_phrase も適切なものに設定されます。

...数で指定します。
reason_phrase も適切なものに設定されます。

@param status ステータスコードを整数で指定します。

require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404

p res.reason_phrase #=> "Not Found"...

FileUtils#sh(*cmd) {|result, status| ... } (12106.0)

与えられたコマンドを実行します。

...nel.#exec を参照してください。


例:
sh %{ls -ltr}

sh 'ls', 'file with spaces'

# check exit status after command runs
sh %{grep pattern file} do |ok, res|
i
f ! ok
puts "pattern not found (status = #{res.exitstatus})"
end
end

@see Kernel.#exec, Kern...

WEBrick::HTTPResponse#status_line -> String (9206.0)

HTTP のステータスラインを CR+LF 付き文字列で返します。

...
H
TTP のステータスラインを CR+LF 付き文字列で返します。

require 'webrick'
res = WEBrick::HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404

p res.status_line #=> "HTTP/1.1 404 Not Found \r\n"...

WEBrick::HTTPResponse#reason_phrase=(val) (9106.0)

HTTP のレスポンスの最初の行の reason phrase をセットします。 この値が nil の場合 reason phrase は status から生成されます。 デフォルトは nil です。

...
H
TTP のレスポンスの最初の行の reason phrase をセットします。
この値が nil の場合 reason phrase は status から生成されます。
デフォルトは nil です。

@param val reason phrase を表す文字列を指定します。

require 'webrick'
res = WEBrick::H...
...TTPResponse.new( { :HTTPVersion => "1.1" } )
res.status = 404

p res.reason_phrase #=> "Not Found"...