るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.187秒)
トップページ > 種類:文書[x] > クエリ:spec/operator[x] > クエリ:クラス/メソッドの定義[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document to_s
  4. rexml/document clone
  5. rexml/document node_type

検索結果

クラス/メソッドの定義 (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
において、「再定義可能な演算子」に分類された演算子の実装
はメソッドなので、定義することが可能で...