るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.087秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:feed[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

ライブラリ

クラス

キーワード

検索結果

Enumerator#feed(obj) -> nil (18307.0)

Enumerator 内部の yield が返す値を設定します。

...yield が返す値を設定します。

これで値を設定しなかった場合は yield は nil を返します。

この値は内部で yield された時点でクリアされます。

//emlist[例][ruby]{
# (1), (2), ... (10) の順に実行される
o = Object.new
def o.each
x = yield...
...# (2) blocks
p x # (5) => "foo"
x = yield # (6) blocks
p x # (8) => nil
x = yield # (9) blocks
p x # not reached w/o another e.next
end

e = o.to_enum
e.next # (1)
e.feed "foo" # (3)
e.next #...
...(4)
e.next # (7)
# (10)
//}

@param obj Enumerator 内部の yield が返す値
@raise TypeError すでに値をこのメソッドでセットしている場合に発生します...

制御構造 (3024.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...制御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END

Rubyでは(Cなどとは異なり)制御構造は式であ...
...call#blockという
制御構造の抽象化を援助する機能があります。ブロック付きメソッド呼び出しは
繰り返しを始めとする制御構造をクラス設計者が定義する事が出来るものです.

=== 条件分岐
====[a:if] if

//emlist[例][ruby]{
if age >=...
.../emlist[例][ruby]{
print "debug\n" if $DEBUG
//}

文法:

式 if 式

右辺の条件が成立する時に、左辺の式を評価してその結果を返します。
条件が成立しなければ nil を返します。

====[a:unless] unless

//emlist[例][ruby]{
unless baby?
feed
_me...

正規表現 (510.0)

正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references

...string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references


正規表現(regular expression)は文字列のパターンを記述するための言語...
...ことが
できます。

//emlist[][ruby]{
place = "東京都"
/#{place}/.match("Go to 東京都") # => #<MatchData "東京都">
//}

埋め込んだ文字列にメタ文字が含まれているならば、それは
メタ文字として認識されます。

//emlist[][ruby]{
number = "(\\d+)"
op...
...al tab (0x0B)
\n 改行 newline (0x0A)
\r 復帰 return (0x0D)
\b バックスペース back space (0x08)
\f 改ページ form feed (0x0C)
\a ベル bell...