12件ヒット
[1-12件を表示]
(0.187秒)
別のキーワード
検索結果
先頭1件
-
クラス/メソッドの定義 (15044.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
* d......f foo a, bとも
a + 3 * b
end
//}
メソッド名としては通常の識別子の他に、再定義可能な演算子(例: ==, +, -
など spec/operator を参照)も指定できます(operator参照)。
//emlist[例][ruby]{
class Vector2D
attr_accessor :x, :y # インスタンス変数@x,......ェクトを返します。
@see https://magazine.rubyist.net/articles/0041/0041-200Special-kwarg.html
====[a:operator] 演算子式の定義
spec/operatorにおいて、「再定義可能な演算子」に分類された演算子の実装
はメソッドなので、定義することが可能で...