るりまサーチ

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

別のキーワード

  1. kernel $stdout
  2. kernel $pid
  3. kernel $stdin
  4. kernel $kcode
  5. kernel $match

検索結果

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

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

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

===[a:class] クラ...
...式は、最後に評価した式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。

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

//emlist[例][ruby]{
def fact(n)
if n == 1 then
1
else
n * fact(n-1)
end
end
//}

文法:

def メソ...
...self._val + other._val
end
end
//}

=== 定義に関する操作

====[a:alias] alias

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

文法:

alias 新メソッド名 旧メソッド名
alias 新グローバル変数名 旧グローバル変数名...