110件ヒット
[1-100件を表示]
(0.078秒)
種類
- インスタンスメソッド (99)
- 定数 (11)
キーワード
- == (11)
-
RFC822
_ MONTHS (11) -
backtrace
_ locations (11) - mon (22)
-
next
_ month (11) -
prev
_ month (11) - strftime (11)
検索結果
先頭5件
-
Time
# month -> Integer (21319.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Date
# month -> Integer (21317.0) -
月を返します (1-12)。
...月を返します (1-12)。... -
Date
# next _ month(n = 1) -> Date (12301.0) -
n ヶ月後を返します。
n ヶ月後を返します。
Date#>> も参照してください。
@param n 月数 -
Date
# prev _ month(n = 1) -> Date (12301.0) -
n ヶ月前を返します。
n ヶ月前を返します。
Date#<< も参照してください。
@param n 月数 -
CGI
:: RFC822 _ MONTHS -> [String] (12300.0) -
822 で定義されている月名の略称を返します。
822 で定義されている月名の略称を返します。
@see 822 -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (9348.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return......if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "t......est.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Time
# mon -> Integer (6219.0) -
月を整数で返します。
...月を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.month # => 1
p t.mon # => 1
//}... -
Date
# mon -> Integer (6217.0) -
月を返します (1-12)。
...月を返します (1-12)。... -
Exception
# ==(other) -> bool (3160.0) -
自身と指定された other のクラスが同じであり、 message と backtrace が == メソッドで比較して 等しい場合に true を返します。そうでない場合に false を返します。
...した場合は
Exception#exception を実行して変換を試みます。
//emlist[例][ruby]{
require "date"
def check_long_month(month)
return if Date.new(2000, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e......d
results = [2, 2, 4].map { |e | get_exception { check_long_month(e) } }
p results.map { |e| e.class }
# => [RuntimeError, RuntimeError, RuntimeError]
p results.map { |e| e.message }
# => ["2 is not long month", "2 is not long month", "4 is not long month"]
# class, message, backtrace が同一の... -
Time
# strftime(format) -> String (364.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
...の名称(Sunday, Monday ... )
* %a: 曜日の省略名(Sun, Mon ... )
* %B: 月の名称(January, February ... )
* %b: 月の省略名(Jan, Feb ... )
* %C: 世紀 (2009年であれば 20)
* %c: 日付と時刻 (%a %b %e %T %Y)
* %D: 日付 (%m/%d/%y)
* %d: 日(01-31)
* %e: 日。一......る ( 1..31)
* %F: %Y-%m-%d と同等 (ISO 8601の日付フォーマット)
* %G: ISO 8601の暦週の年
* %g: ISO 8601の暦週の年の下2桁(00-99)
* %H: 24時間制の時(00-23)
* %h: %b と同等
* %I: 12時間制の時(01-12)
* %j: 年中の通算日(001-366)
* %k: 24時間......Calendar date (basic)
p t.strftime("%F") # => 2001-02-03 Calendar date (extended)
p t.strftime("%Y-%m") # => 2001-02 Calendar date, reduced accuracy, specific month
p t.strftime("%Y") # => 2001 Calend...