るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.011秒)

別のキーワード

  1. prime next
  2. _builtin next
  3. date next
  4. date next_day
  5. date next_year

ライブラリ

クラス

キーワード

検索結果

Date#>>(n) -> Date (18161.0)

self から n ヶ月後の日付オブジェクトを返します。 n は数値でなければなりません。

...Date.new(2001,2,3) >> 1 #=> #<Date: 2001-03-03 ...>
Date.new(2001,2,3) >> -2 #=> #<Date: 2000-12-03 ...>
//}


対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。

//emlist[][ruby]{
require 'date'
Date.new(2001,1,28) >> 1 #=> #<Date: 20...
...(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
//}

このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。

//emlist[][ruby]{
require 'date'
Date.new(2001,1,31) >> 2 #=> #<Date: 2001-03-31 ...>
Date.new(2001,1,31) >> 1 >> 1 #=> #...
...<Date: 2001-03-28 ...>

Date.new(2001,1,31) >> 1 >> -1 #=> #<Date: 2001-01-28 ...>
//}

Date#next_month も参照してください。

@param n 月数...

Date#next_year(n = 1) -> Date (6125.0)

n 年後を返します。

...ます。

self >> (n * 12) に相当します。

//emlist[例][ruby]{
require 'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}

Date#>> も参照し...

rexml/parsers/pullparser (150.0)

プル方式の XML パーサ。

...s_next?
p parser.pull
end
# >> xmldecl: ["1.0", "UTF-8", nil]
# >> text: ["\n", "\n"]
# >> processing_instruction: ["xml-stylesheet", " type=\"text/css\" href=\"style.css\""]
# >> text: ["\n", "\n"]
# >> start_doctype: ["root", "SYSTEM", "foo", nil]
# >> elementdecl: ["<!ELEMENT root (a+)"]
# >> e...
...lementdecl: ["<!ELEMENT a"]
# >> entitydecl: ["bar", "barbarbarbar"]
# >> attlistdecl: ["a", {"att"=>nil, "xyz"=>"foobar"}, " \n <!ATTLIST a att CDATA #REQUIRED xyz CDATA \"foobar\">"]
# >> notationdecl: ["foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]
# >> entitydecl: ["HTMLsymbol", "PUB...
...html-symbol.ent", "%"]
# >> externalentity: ["%HTMLsymbol;"]
# >> end_doctype: []
# >> text: ["\n", "\n"]
# >> start_element: ["root", {"xmlns:foo"=>"http://example.org/foo", "xmlns:bar"=>"http://example.org/bar"}]
# >> cdata: ["cdata is here"]
# >> text: ["\n ", "\n "]
# >> start_element: ["a", {...

Numeric (18.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...o o - -
>= | - - o o o - -
>>
| - - o o - - -
[] | - - o...
...o o - -
nan? | - - - - o - -
next
| - o - - - - -
nonzero? | o - -...
...> | - o o - -
>= | - o o - -
>>
| - o - - -
[] | - o - - -...
...o - -
negative? | o - o o -
next
| - o - - -
next
_float | - - o - -
nonzero? | o...