るりまサーチ

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

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. object nil
  5. _builtin nil

ライブラリ

クラス

キーワード

検索結果

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

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

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

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

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

//emlist[例][ruby]{
# (1), (2), ... (10) の順に実行される
o = Object.new
def...
...# (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 内部の yiel...

正規表現 (156.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)は文字列のパターンを記述するための言...
...帰 return (0x0D)
\b バックスペース back space (0x08)
\f 改ページ form feed (0x0C)
\a ベル bell (0x07)
\e エスケープ文字 escape (0x1B)
\nnn...
...match("y") # => #<MatchData "y">
/[a-z[0-9]]/.match("[") # => nil
r = /[a-w&&[^c-g]e]/ # ([a-w] かつ ([^c-g] もしくは e)) つまり [abeh-w] と同じ
r.match("b") # => #<MatchData "b">
r.match("c") # => nil
r.match("e") # => #<MatchData "e">
r.match("g") # => nil
r.match("h") # => #<MatchData...

制御構造 (144.0)

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

...節)の最後に評価し
た式の結果を返します。else 節がなくいずれの条件も成り立たなけれ
nil を返します。

Ruby では false または nil だけが偽で、それ以外は 0 や空文
字列も含め全て真です。

Ruby では if を繋げるのは elsif...
...時に、左辺の式を評価してその結果を返します。
条件が成立しなければ nil を返します。

====[a:unless] unless

//emlist[例][ruby]{
unless baby?
feed
_meat
else
feed
_milk
end
//}

文法:

unless 式 [then]
式 ...
[else...
...式 unless 式

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

====[a:case] case

//emlist[例][ruby]{
case $age
when 0 .. 2
"baby"
when 3 .. 6
"little child"
when 7 .. 12
"child"
when...