るりまサーチ

最速Rubyリファレンスマニュアル検索!
358件ヒット [1-100件を表示] (0.169秒)

別のキーワード

  1. fiddle sym
  2. _builtin to_sym
  3. handle sym
  4. string to_sym
  5. symbol to_sym

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Symbol#to_s -> String (21202.0)

シンボルに対応する文字列を返します。

...シンボルに対応する文字列を返します。

逆に、文字列に対応するシンボルを得るには
String#intern を使います。

p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true

@see String#intern...
...シンボルに対応する文字列を返します。

逆に、文字列に対応するシンボルを得るには
String#intern を使います。

p :foo.id2name # => "foo"
p :foo.id2name.intern == :foo # => true

@see String#intern
@see Symbol#name...

Symbol#to_sym -> self (15302.0)

self を返します。

...self を返します。

例:

:foo.intern # => :foo

@see String#intern...

String#to_sym -> Symbol (12414.0)

文字列に対応するシンボル値 Symbol を返します。

...ボル値 Symbol を返します。

なお、このメソッドの逆にシンボルに対応する文字列を得るには
Sym
bol#to_s または Symbol#id2name を使います。

シンボル文字列にはヌルキャラクタ("\0")、空の文字列の使用も可能です。

//emlist[例][rub...
...y]{
p "foo".intern # => :foo
p "foo".intern.to_s == "foo" # => true
//}...

Symbol#capitalize -> Symbol (9207.0)

シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した シンボルを返します。

...に、残りを小文字に変更した
シンボルを返します。

(self.to_s.capitalize.intern と同じです。)

:foobar.capitalize #=> :Foobar
:fooBar.capitalize #=> :Foobar
:FOOBAR.capitalize #=> :Foobar
:"foobar--".capitalize # => "Foobar--"

@see String#capitalize...

Symbol#capitalize(*options) -> Symbol (9207.0)

シンボルに対応する文字列の先頭の文字を大文字に、残りを小文字に変更した シンボルを返します。

...に、残りを小文字に変更した
シンボルを返します。

(self.to_s.capitalize.intern と同じです。)

:foobar.capitalize #=> :Foobar
:fooBar.capitalize #=> :Foobar
:FOOBAR.capitalize #=> :Foobar
:"foobar--".capitalize # => "Foobar--"

@see String#capitalize...

絞り込み条件を変える

Symbol#match(other) -> MatchData | nil (9207.0)

正規表現 other とのマッチを行います。

...other とのマッチを行います。

(self.to_s.match(other) と同じです。)

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

@return マッチが成功すれば MatchData オブジェクトを、そうでなければ nil を返します。

p :foo.match(/foo/) # => #<Mat...
...chData "foo">
p :foobar.match(/bar/) # => #<MatchData "bar">
p :foo.match(/bar/) # => nil

@see String#match
@see Symbol#match?...

Symbol#next -> Symbol (9207.0)

シンボルに対応する文字列の「次の」文字列に対応するシンボルを返します。

...シンボルに対応する文字列の「次の」文字列に対応するシンボルを返します。

(self.to_s.next.intern と同じです。)

:a.next # => :b
:foo.next # => :fop

@see String#succ...

Pathname#make_symlink(old) -> 0 (9117.0)

File.symlink(old, self.to_s) と同じです。

...File.symlink(old, self.to_s) と同じです。


@see File.symlink...

Pathname#symlink? -> bool (9117.0)

FileTest.symlink?(self.to_s) と同じです。

...FileTest.symlink?(self.to_s) と同じです。


@see FileTest.#symlink?...

Symbol#end_with?(*suffixes) -> bool (9107.0)

self の末尾が suffixes のいずれかであるとき true を返します。

...とき true を返します。

(self.to_s.end_with?と同じです。)

@param suffixes パターンを表す文字列 (のリスト)

@see Symbol#start_with?

@see String#end_with?

//emlist[][ruby]{
:hello.end_with?("ello") #=> true

# returns true if one of the +suffixes+ matches....
...:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false
//}...

絞り込み条件を変える

Symbol#length -> Integer (9107.0)

シンボルに対応する文字列の長さを返します。

...シンボルに対応する文字列の長さを返します。

(self.to_s.length と同じです。)

:foo.length #=> 3

@see String#length, String#size...
<< 1 2 3 ... > >>