るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string []
  4. string slice!
  5. string gsub!

ライブラリ

モジュール

キーワード

検索結果

<< < ... 8 9 10 >>

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

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

...に指定しても同じ)
class Foo
def bar
end
end

# 間違ったスーパークラスを指定するとエラー
class Foo < String
end
# => superclass mismatch for class Foo (TypeError)
//}

クラス定義式の中は self がそのクラスであることと、
limitのデフォルトが...
...self._val + other._val
end
end
//}

=== 定義に関する操作

====[a:alias] alias

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

文法:

alias 新メソッド名 旧メソッド名
alias 新グローバル変数名 旧グローバル変数名...
<< < ... 8 9 10 >>