るりまサーチ

最速Rubyリファレンスマニュアル検索!
13件ヒット [1-13件を表示] (0.039秒)
トップページ > クラス:Symbol[x] > クエリ:_builtin[x] > クエリ:casecmp[x] > クエリ:<=>[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

検索結果

Symbol#<=>(other) -> -1 | 0 | 1 | nil (26132.0)

self と other のシンボルに対応する文字列を ASCII コード順で比較して、 self が小さい時には -1、等しい時には 0、大きい時には 1 を返します。

...ルではなく比較できない時には nil を返します。

- **param** `other` -- 比較対象のシンボルを指定します。

```ruby
p :aaa <=> :xxx # => -1
p :aaa <=> :aaa # => 0
p :xxx <=> :aaa # => 1
p :foo <=> "foo" # => nil
```

- **SEE** [m:String#<=>], [m:Symbol#casecmp]...