るりまサーチ (Ruby 3.2)

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

キーワード

検索結果

Symbol#end_with?(*suffixes) -> bool (18397.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+ mat...

Symbol#start_with?(*prefixes) -> bool (22.0)

self の先頭が prefixes のいずれかであるとき true を返します。

...します。

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

@param prefixes パターンを表す文字列または正規表現 (のリスト)

@see Symbol#end_with?

@see String#start_with?

//emlist[][ruby]{
:hello.start_with?("hell") #=> true
:hello.start_with?(/H/i) #=...

Symbol.all_symbols -> [Symbol] (22.0)

定義済みの全てのシンボルオブジェクトの配列を返します。

...定義済みの全てのシンボルオブジェクトの配列を返します。

p Symbol.all_symbols #=> [:RUBY_PLATFORM, :RUBY_VERSION, ...]

リテラルで表記したシンボルのうち、コンパイル時に値が決まるものはその時に生成されます。
それ以外の式...
...def number
'make_3'
end

p Symbol.all_symbols.select{|sym|sym.to_s.include? 'make'}
#=> [:make_1, :make_2]

re = #確実に生成されるように代入操作を行う
:make_1,
:'make_2',
:"#{number}",
'make_4'.intern

p Symbol.all_symbols.select{|sym|sym.to_s.include? 'mak...