182件ヒット
[1-100件を表示]
(0.116秒)
種類
- 特異メソッド (96)
- インスタンスメソッド (86)
ライブラリ
- date (158)
-
json
/ add / date (24)
キーワード
- - (12)
- ajd (12)
- amjd (12)
- civil (12)
-
deconstruct
_ keys (2) - httpdate (12)
-
json
_ create (12) - mon (12)
- month (12)
- new (12)
-
prev
_ month (12) - rfc2822 (12)
- rfc822 (12)
-
to
_ json (12) -
valid
_ civil? (12) -
valid
_ date? (12)
検索結果
先頭5件
-
Date
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (12201.0) -
パターンマッチに使用する名前と値の Hash を返します。
...ear
* :month
* :day
* :yday
* :wday
@param array_of_names_or_nil パターンマッチに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
d = Date.new(2022, 10, 5)
if d in wday: 3, day: ..7 # deconstru......われます
puts "first Wednesday of the month"
end
#=> "first Wednesday of the month" が出力される
case d
in year: ...2022
puts "too old"
in month: ..9
puts "quarter 1-3"
in wday: 1..5, month:
puts "working day in month #{month}"
end
#=> "working day in month 10" が出力される......# クラスのチェックと組み合わせて利用することもできます
if d in Date(wday: 3, day: ..7)
puts "first Wednesday of the month"
end
//}
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Date
# prev _ month(n = 1) -> Date (12201.0) -
n ヶ月前を返します。
...n ヶ月前を返します。
Date#<< も参照してください。
@param n 月数... -
Date
. json _ create(hash) -> Date (12201.0) -
JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
...JSON のオブジェクトから Ruby のオブジェクトを生成して返します。
@param hash 適切なキーを持つハッシュを指定します。... -
Date
# mon -> Integer (6201.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Date
# month -> Integer (6201.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Date
# to _ json(*args) -> String (6201.0) -
自身を JSON 形式の文字列に変換して返します。
...身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡され......ます。
//emlist[例][ruby]{
require "json/add/core"
Date.today.to_json
# => "{\"json_class\":\"Date\",\"y\":2018,\"m\":12,\"d\":11,\"sg\":2299161.0}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
Date
. rfc2822(str = & # 39;Mon , 1 Jan -4712 00:00:00 +0000& # 39; , start = Date :: ITALY) -> Date (6201.0) -
2822 で定められた書式の日付を解析し、 その情報に基づいて日付オブジェクトを生成します。
...2 で定められた書式の日付を解析し、
その情報に基づいて日付オブジェクトを生成します。
Date._rfc2822 も参照してください。
@param str 日付をあらわす文字列
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日... -
Date
. rfc822(str = & # 39;Mon , 1 Jan -4712 00:00:00 +0000& # 39; , start = Date :: ITALY) -> Date (6201.0) -
2822 で定められた書式の日付を解析し、 その情報に基づいて日付オブジェクトを生成します。
...2 で定められた書式の日付を解析し、
その情報に基づいて日付オブジェクトを生成します。
Date._rfc2822 も参照してください。
@param str 日付をあらわす文字列
@param start グレゴリオ暦をつかい始めた日をあらわすユリウス日... -
Date
# -(x) -> Rational | Date (201.0) -
x が日付オブジェクトなら、ふたつの差を Rational で返します。単位は日です。 あるいは x が数値ならば、self より x 日前の日付を返します。
...オブジェクトなら、ふたつの差を Rational で返します。単位は日です。
あるいは
x が数値ならば、self より x 日前の日付を返します。
@param x 日数、あるいは日付オブジェクト
@raise TypeError x が数値でも日付オブジェクトでも... -
Date
# ajd -> Rational (201.0) -
このメソッドは Date#jd と似ていますが、天文学的なユリウス日を返します。 時刻を含みます。
...このメソッドは Date#jd と似ていますが、天文学的なユリウス日を返します。
時刻を含みます。...