るりまサーチ

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

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

String#upto(max, exclusive = false) {|s| ... } -> self (18224.0)

self から始めて max まで 「次の文字列」を順番にブロックに与えて繰り返します。 「次」の定義については String#succ を参照してください。

...
self
から始めて max まで
「次の文字列」を順番にブロックに与えて繰り返します。
「次」の定義については String#succ を参照してください。

たとえば以下のコードは a, b, c, ... z, aa, ... az, ..., za を
出力します。

//emlist[][ruby]...
...{
("a" .. "za").each do |str|
puts str
end
'a'.upto('za') do |str|
puts str
end
//}

@param max 繰り返しをやめる文字列

@param exclusive max を含むかどうか。false の場合は max を含む。...

Date#upto(max) {|date| ...} -> self (18203.0)

このメソッドは、step(max, 1){|date| ...} と等価です。

このメソッドは、step(max, 1){|date| ...} と等価です。

@param max 日付オブジェクト

@see Date#step, Date#downto

Integer#upto(max) -> Enumerator (18146.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...
self
から max まで 1 ずつ増やしながら繰り返します。
self
> max であれば何もしません。

@param max 数値
@return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@see Integer#downto, Numeric#step, Integer#times...

Integer#upto(max) {|n| ... } -> Integer (18146.0)

self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。

...
self
から max まで 1 ずつ増やしながら繰り返します。
self
> max であれば何もしません。

@param max 数値
@return self を返します。

//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}

@see Integer#downto, Numeric#step, Integer#times...

Date#upto(max) -> Enumerator (18103.0)

このメソッドは、step(max, 1){|date| ...} と等価です。

このメソッドは、step(max, 1){|date| ...} と等価です。

@param max 日付オブジェクト

@see Date#step, Date#downto

絞り込み条件を変える

Integer#downto(min) {|n| ... } -> self (145.0)

self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。

...
self
から min まで 1 ずつ減らしながらブロックを繰り返し実行します。
self
< min であれば何もしません。

@param min 数値
@return self を返します。

//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}

@see Integer#upto, Numeric#ste...

Integer#times {|n| ... } -> self (145.0)

self 回だけ繰り返します。 self が正の整数でない場合は何もしません。

...
self
回だけ繰り返します。
self
が正の整数でない場合は何もしません。

またブロックパラメータには 0 から self - 1 までの数値が渡されます。

//emlist[][ruby]{
3.times { puts "Hello, World!" } # Hello, World! と3行続いて表示される。
0.t...
...imes { puts "Hello, World!" } # 何も表示されない。
5.times {|n| print n } # 01234 と表示される。
//}

@see Integer#upto, Integer#downto, Numeric#step...

1.6.8から1.8.0への変更点(まとめ) (144.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...ました
((<ruby-bugs-ja:313>))。なんだかよくわかりません(^^;

class << Object
p [self.id, self]
class << self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]...
...さあっぱりわかりません(^^;;

class << Object.new
class << self.superclass
p [self.id, self]
end
class << self
p [self.superclass.id, self.superclass]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]...
...586-linux]
3
nil
=> ruby 1.8.0 (2003-07-03) [i586-linux]
nil
nil

: ((<String#upto|String/upto>)) [bug]

String#upto の範囲チェックが辞書順だったバグが修正されました。
現在は、((<String/succ>)) の動作と一致し...

Date#downto(min) {|date| ...} -> self (107.0)

このメソッドは、step(min, -1){|date| ...} と等価です。

...このメソッドは、step(min, -1){|date| ...} と等価です。

@param min 日付オブジェクト

@see Date#step, Date#upto...
<< 1 2 3 > >>