るりまサーチ

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

別のキーワード

  1. open3 popen2e
  2. socket af_e164
  3. matrix det_e
  4. matrix rank_e
  5. open3 capture2e

種類

ライブラリ

モジュール

検索結果

Kernel$$MATCH -> String | nil (21207.0)

$& の別名

...$& の別名

require "English"

str = 'hoge,foo,bar,hee,hoo'

/(foo|bar)/ =~ str
p $MATCH #=> "foo"...

クラス/メソッドの定義 (3114.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined

===[a:class] クラス定義

//emlist[例][ruby]{
class Foo < Super
def test...
...ます。

===[a:method] メソッド定義

//emlist[例][ruby]{
def fact(n)
if n == 1 then
1
e
lse
n * fact(n-1)
e
nd
e
nd
//}

文法:

def メソッド名 ['(' [arg0 ['=' default0]] ... [',' '*' rest_args [, post ...]] [',' key1: [val1]] ... [',' '**'kwrest] [',' '&' block_a...
...想定
# _val が private だと関数形式でしか呼べないため
# このように利用できない

self._val + other._val
e
nd
e
nd
//}

=== 定義に関する操作

====[a:alias] alias

//emlist[例][ruby]{
alias foo bar
alias :foo :bar
alias $MATCH $&
//}

文法:...