55件ヒット
[1-55件を表示]
(0.141秒)
別のキーワード
種類
- インスタンスメソッド (33)
- 特異メソッド (22)
ライブラリ
- ビルトイン (11)
- time (33)
-
webrick
/ httpresponse (11)
クラス
- Time (33)
- UnboundMethod (11)
-
WEBrick
:: HTTPResponse (11)
キーワード
- []= (11)
- parse (22)
-
source
_ location (11)
検索結果
先頭5件
-
Time
# httpdate -> String (21313.0) -
2616 で定義されている HTTP-date の rfc1123-date 形式の文字列を 返します。
...る HTTP-date の rfc1123-date 形式の文字列を
返します。
@return 以下の形式の文字列を返します。
//emlist{
day-of-week, DD month-name CCYY hh:mm:ss GMT
//}
注意: 結果はいつも UTC (GMT) です。
使用例
require 'time'
iso8601_time = '2008-08-31T12......:34:56+09:00'
t = Time.iso8601(iso8601_time)
p t.httpdate #=> "Sun, 31 Aug 2008 03:34:56 GMT"... -
UnboundMethod
# source _ location -> [String , Integer] | nil (12212.0) -
ソースコードのファイル名と行番号を配列で返します。
...が ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。
//emlist[例][ruby]{
require 'time'
Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/rub......y/2.4.0/time.rb", 654]
//}
@see Proc#source_location, Method#source_location... -
Time
. parse(date , now = Time . now) -> Time (9330.0) -
...date を Date._parse によって
パースして Timeオブジェクトに変換します。
ブロック付きで呼ばれた場合、dateの年はブロックによって変換されます。
require 'time'
Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
与えられ......
require 'time'
time = Time.local(2019, 5, 1)
Time.parse("12:00", time) #=> 2019-05-01 12:00:00 +0900
下位の要素がなかったり壊れていた場合、最小値(1か0)が使われます。
@param date Time オブジェクトに変換可能な文字列を指定します。
@param n......ArgumentError が発生します。
このメソッドは他のパース用メソッドのフェイルセーフとして
以下のように使用できます:
require 'time'
Time.rfc2822(date) rescue Time.parse(date)
Time.httpdate(date) rescue Time.parse(date)
Time.xmlschema(date) rescue... -
Time
. parse(date , now = Time . now) {|year| year } -> Time (9330.0) -
...date を Date._parse によって
パースして Timeオブジェクトに変換します。
ブロック付きで呼ばれた場合、dateの年はブロックによって変換されます。
require 'time'
Time.parse(...) {|y| y < 100 ? (y >= 69 ? y + 1900 : y + 2000) : y}
与えられ......
require 'time'
time = Time.local(2019, 5, 1)
Time.parse("12:00", time) #=> 2019-05-01 12:00:00 +0900
下位の要素がなかったり壊れていた場合、最小値(1か0)が使われます。
@param date Time オブジェクトに変換可能な文字列を指定します。
@param n......ArgumentError が発生します。
このメソッドは他のパース用メソッドのフェイルセーフとして
以下のように使用できます:
require 'time'
Time.rfc2822(date) rescue Time.parse(date)
Time.httpdate(date) rescue Time.parse(date)
Time.xmlschema(date) rescue... -
WEBrick
:: HTTPResponse # []=(field , val) (6112.0) -
レスポンスの該当するヘッダに val を設定します。
...@param field ヘッダ名を文字列で指定します。大文字と小文字を区別しません。
@param val ヘッダの値を指定します。to_s メソッドによって文字列に変換されます。
require 'time'
res['last-modified'] = Time.now.httpdate
@see WEBrick::HTTPResp......onse#chunked?, WEBrick::HTTPResponse#content_length,
WEBrick::HTTPResponse#content_type...