180件ヒット
[1-100件を表示]
(0.206秒)
キーワード
- << (11)
- == (11)
- >> (11)
-
backtrace
_ locations (11) - byteoffset (4)
- httpdate (11)
- mon (22)
-
next
_ month (11) - offset (22)
-
prev
_ month (11) - rfc2822 (11)
- rfc822 (11)
- strftime (11)
検索結果
先頭5件
-
Time
# month -> Integer (21308.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 (21302.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Date
# next _ month(n = 1) -> Date (12225.0) -
n ヶ月後を返します。
...n ヶ月後を返します。
Date#>> も参照してください。
@param n 月数... -
Date
# prev _ month(n = 1) -> Date (12225.0) -
n ヶ月前を返します。
...n ヶ月前を返します。
Date#<< も参照してください。
@param n 月数... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (6143.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...on#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Date.n......000, 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>'", "test.rb:9:in `g......et_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
Time
# mon -> Integer (6108.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 (6102.0) -
月を返します (1-12)。
月を返します (1-12)。 -
Exception
# ==(other) -> bool (3055.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
e
end
end
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 が同一のため true... -
MatchData
# offset(n) -> [Integer , Integer] | [nil , nil] (151.0) -
n 番目の部分文字列のオフセットの配列 [start, end] を返 します。
...
n 番目の部分文字列のオフセットの配列 [start, end] を返
します。
//emlist[例][ruby]{
[ self.begin(n), self.end(n) ]
//}
と同じです。n番目の部分文字列がマッチしていなければ
[nil, nil] を返します。
@param n 部分文字列を指定する数値......@raise IndexError 範囲外の n を指定した場合に発生します。
@see MatchData#begin, MatchData#end......@raise IndexError 範囲外の n を指定した場合に発生します。
@see MatchData#begin, MatchData#end, MatchData#offset... -
Date
# <<(n) -> Date (146.0) -
self より n ヶ月前の日付オブジェクトを返します。 n は数値でなければなりません。
...self より n ヶ月前の日付オブジェクトを返します。
n は数値でなければなりません。
//emlist[][ruby]{
require 'date'
Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
Date.new(2001,2,3) << -2 #=> #<Date: 2001-04-03 ...>
//}
対応する月に同じ日が存......quire 'date'
Date.new(2001,3,28) << 1 #=> #<Date: 2001-02-28 ...>
Date.new(2001,3,31) << 1 #=> #<Date: 2001-02-28 ...>
//}
このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。
//emlist[][ruby]{
require 'date'
Date.new(2001,3,31) <<......2 #=> #<Date: 2001-01-31 ...>
Date.new(2001,3,31) << 1 << 1 #=> #<Date: 2001-01-28 ...>
Date.new(2001,3,31) << 1 << -1 #=> #<Date: 2001-03-28 ...>
//}
Date#prev_month も参照してください。
@param n 月数...