10件ヒット
[1-10件を表示]
(0.051秒)
ライブラリ
- date (9)
-
json
/ add / date (1)
キーワード
- - (1)
- ajd (1)
- amjd (1)
-
deconstruct
_ keys (1) - mon (1)
- monday? (1)
- month (1)
-
next
_ month (1) -
prev
_ month (1) -
to
_ json (1)
検索結果
先頭5件
-
Date
# deconstruct _ keys(array _ of _ names _ or _ nil) -> Hash (18307.0) -
パターンマッチに使用する名前と値の Hash を返します。
...チに使用する名前の配列を指定します。nil の場合は全てをパターンマッチに使用します。
//emlist[例][ruby]{
d = Date.new(2022, 10, 5)
if d in wday: 3, day: ..7 # deconstruct_keys が使われます
puts "first Wednesday of the month"
end
#=> "first Wednesday of......g 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
# mon -> Integer (18307.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Date
# monday? -> bool (18307.0) -
月曜日なら真を返します。
月曜日なら真を返します。 -
Date
# month -> Integer (18307.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Date
# next _ month(n = 1) -> Date (18307.0) -
n ヶ月後を返します。
...n ヶ月後を返します。
Date#>> も参照してください。
@param n 月数... -
Date
# prev _ month(n = 1) -> Date (18307.0) -
n ヶ月前を返します。
...n ヶ月前を返します。
Date#<< も参照してください。
@param n 月数... -
Date
# to _ json(*args) -> String (18307.0) -
自身を JSON 形式の文字列に変換して返します。
...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
# -(x) -> Rational | Date (307.0) -
x が日付オブジェクトなら、ふたつの差を Rational で返します。単位は日です。 あるいは x が数値ならば、self より x 日前の日付を返します。
x が日付オブジェクトなら、ふたつの差を Rational で返します。単位は日です。
あるいは
x が数値ならば、self より x 日前の日付を返します。
@param x 日数、あるいは日付オブジェクト
@raise TypeError x が数値でも日付オブジェクトでもない場合に発生します。 -
Date
# ajd -> Rational (307.0) -
このメソッドは Date#jd と似ていますが、天文学的なユリウス日を返します。 時刻を含みます。
...このメソッドは Date#jd と似ていますが、天文学的なユリウス日を返します。
時刻を含みます。... -
Date
# amjd -> Rational (307.0) -
このメソッドは Date#mjd と似ていますが、天文学的な修正ユリウス日を返します。 時刻を含みます。
...このメソッドは Date#mjd と似ていますが、天文学的な修正ユリウス日を返します。
時刻を含みます。...