self <=> other -> -1 | 0 | 1 | nil[permalink][rdoc][edit](Numeric other) → Integer-
selfをotherと比較し、selfがotherより大きければ1を、等しければ0を、小さければ-1を返します。比較できないときはnilを返します。Numericのサブクラスは必要に応じてこのメソッドを適切に再定義しなければなりません。Numericオブジェクトを左項とする比較演算子<=>はこのメソッドの呼び出しになります。- [PARAM]
other: - 比較対象
p 1 <=> 0 # => 1 p 1 <=> 1 # => 0 p 1 <=> 2 # => -1 p 1 <=> "0" # => nil - [PARAM]