るりまサーチ (Ruby 2.4.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.025秒)
トップページ > バージョン:2.4.0[x] > ライブラリ:ビルトイン[x] > クエリ:ASCII[x] > クラス:Symbol[x]

別のキーワード

  1. nkf ascii
  2. zlib ascii
  3. kconv ascii
  4. encoding ascii
  5. _builtin ascii

キーワード

検索結果

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

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

...er がシンボルではなく比較できない時には nil を返します。

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

//emlist[][ruby]{
p :aaa <=> :xxx # => -1
p :aaa <=> :aaa # => 0
p :xxx <=> :aaa # => 1
p :foo <=> "foo" # => nil
//}

@see String#<=>, Symbol#casecmp...

Symbol#encoding -> Encoding (28.0)

シンボルに対応する文字列のエンコーディング情報を表現した Encoding オブ ジェクトを返します。

シンボルに対応する文字列のエンコーディング情報を表現した Encoding オブ
ジェクトを返します。

例:

# encoding: utf-8

:foo.encoding # => #<Encoding:US-ASCII>
:あかさたな.encoding # => #<Encoding:UTF-8>

@see String#encoding