るりまサーチ

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

別のキーワード

  1. fiddle ref
  2. entity ref
  3. pointer ref
  4. _builtin _id2ref
  5. rexml/document ref

クラス

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

String#delete_prefix!(prefix) -> self | nil (6202.0)

self の先頭から破壊的に prefix を削除します。

...prefix を削除します。

@param prefix 先頭から削除する文字列を指定します。

@return 削除した場合は self、変化しなかった場合は nil

//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}

@see String#delete_prefi...

String#delete_prefix(prefix) -> String (6202.0)

文字列の先頭から prefix を削除した文字列のコピーを返します。

...ら prefix を削除した文字列のコピーを返します。

@param prefix 先頭から削除する文字列を指定します。

@return 文字列の先頭から prefix を削除した文字列のコピー

//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo")...
...# => "hello"
//}

@see String#delete_prefix!
@see String#delete_suffix
@see String#start_with?...

ObjectSpace.#_id2ref(id) -> object (6109.0)

オブジェクト ID(BasicObject#__id__)からオブジェクトを得ます。

...id__)からオブジェクトを得ます。

@param id 取得したいオブジェクトの ID を整数で指定します。

@raise RangeError 対応するオブジェクトが存在しなければ発生します。

//emlist[例][ruby]{
a = "hoge"
p ObjectSpace._id2ref(a.__id__) #=> "hoge"
//}...

GC.verify_compaction_references(toward: nil, double_heap: nil) -> Hash (6102.0)

コンパクションの参照の一貫性を検証します。

コンパクションの参照の一貫性を検証します。

このメソッドは処理系依存 (CRuby 特有) です。
コンパクション中に移動されたオブジェクトは T_MOVED オブジェクトに置き換えられます。
コンパクション後には T_MOVED を参照するオブジェクトは存在するべきではありません。

この関数は全てのオブジェクトが移動する余地を確保するためにヒープを2倍にして、
全ての移動を確実にするためにヒープをコンパクションして、全ての参照を更新して、
それからフルGCを実行します。
もし T_MOVED への参照をもつオブジェクトがあれば、マークスタックにプッシュされて、
SEGV が起きるでしょ...

Module#refine(klass) { ... } -> Module (6102.0)

引数 klass で指定したクラスまたはモジュールだけに対して、ブロックで指定した機能を提供で きるモジュールを定義します。定義した機能は Module#refine を使用せずに直 接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。 そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。

...義した機能は Module#refine を使用せずに直
接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。
そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。

ref
inements 機能の詳細に...
...ついては以下を参照してください。

* https://magazine.rubyist.net/articles/0041/0041-200Special-refinement.html
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html

定義した機能は main.using, Module#using を実行した場合のみ
有効になります。

@...
...指定した機能を持つ無名のモジュールを返します。

//emlist[例][ruby]{
class C
def foo
puts "C#foo"
end
end

module M
ref
ine C do
def foo
puts "C#foo in M"
end
end
end

x = C.new
x.foo # => "C#foo"

using M

x = C.new
x.foo # => "C#foo in M"
//}

@see m...

絞り込み条件を変える

Errno::ECONNREFUSED (6002.0)

システムコールのエラーコードを表す例外クラスです。詳細は Errno::EXXX を参照してください。

システムコールのエラーコードを表す例外クラスです。詳細は Errno::EXXX を参照してください。

Errno::ETOOMANYREFS (6002.0)

システムコールのエラーコードを表す例外クラスです。詳細は Errno::EXXX を参照してください。

システムコールのエラーコードを表す例外クラスです。詳細は Errno::EXXX を参照してください。

Refinement (6002.0)

refine のブロックの中の self のクラスです。

...refine のブロックの中の self のクラスです。

Ref
inement#import_methodsで他のモジュールからメソッドを
インポートできます。...

Refinement#import_methods(*modules) -> self (3002.0)

モジュールからメソッドをインポートします。

...ールからメソッドをインポートします。

Module#includeと違って、import_methods はメソッドをコピーして
ref
inement に追加して、refinementでインポートしたメソッドを有効化します。

メソッドをコピーするため、Rubyコードで定義さ...
...mlist[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end

module M
ref
ine String do
import_methods StrUtils
end
end

using M
p "foo".indent(3) # => " foo"

module M
ref
ine String do
import_methods Enumerable
# Can't import method which is not defined wi...

String#start_with?(*prefixes) -> bool (102.0)

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

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

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

//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_w...
...ith?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}

@see String#end_with?
@see String#delete_prefix, String#delete_prefix!...

絞り込み条件を変える

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

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

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

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

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

@see Symbol#end_with?

@see String#start_with?

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

# returns true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}...

ARGF.class#inplace_mode -> String | nil (24.0)

c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。

c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。

Ruby 起動時の -i オプション や ARGF.class#inplace_mode= で設定します。

例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"

# test...
<< 1 2 3 ... > >>