るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string []
  4. string slice!
  5. string gsub

種類

ライブラリ

キーワード

検索結果

Kernel.#autoload?(const_name) -> String | nil (6208.0)

const_name が Kernel.#autoload 設定されているか調べます。

...const_name が Kernel.#autoload 設定されているか調べます。

autoload 設定されていて、autoload 定数がまだ定義されてない(ロードされていない)
ときにそのパス名を返します。

autoload 設定されていないか、ロード済みなら nil を返し...
...const_name 定数をString または Symbol で指定します。

//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
end
p Foo.autoload?(:Bar) #=> nil
Foo.autoload :Bar, '/tmp/foo'
p Foo.autoload?(:Bar) #=>...
..."/tmp/foo"
p Foo::Bar #=> Foo::Bar
p Foo.autoload?(:Bar) #=> nil
//}

@see Kernel.#autoload...

Kernel.#autoload(const_name, feature) -> nil (6107.0)

定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。

...照した時に feature を
Kernel
.#require するように設定します。

const_name には、 "::" 演算子を含めることはできません。
ネストした定数を指定する方法は Module#autoload を参照してください。

const_name が autoload 設定されていて、ま...
...)ときは、
autoload する対象を置き換えます。
const_name が(autoloadではなく)既に定義されているときは何もしません。

@param const_name 定数をString または Symbol で指定します。
@param feature require と同様な方法で autoload する対象を指...
...定します。
@raise LoadError featureのロードに失敗すると発生します。

//emlist[][ruby]{
# ------- /tmp/foo.rb ---------
class Bar
end
# ----- end of /tmp/foo.rb ----

autoload :Bar, '/tmp/foo'
p Bar #=> Bar
//}

@see Kernel.#autoload?,Module#autoload,Kernel.#require...

Kernel$$LOAD_PATH -> [String] (3223.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...
...には

$ ruby -e 'puts $:'

とします。

$LOAD_PATH の特異メソッドとして resolve_feature_path が定義されています。
require を呼んだときに読み込まれるファイルを特定できます。

//emlist[][ruby]{
p $LOAD_PATH.resolve_feature_path('set')
# => [:rb, "/b...

Kernel$$LOADED_FEATURES -> [String] (3203.0)

Kernel.#require でロードされたファイル名を含む配列です。

...
Kernel
.#require でロードされたファイル名を含む配列です。

Kernel
.#require で同じファイルを
複数回ロードしないようにするためのロックとして使われます。

この変数はグローバルスコープです。...

Kernel$$-I -> [String] (123.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...
...には

$ ruby -e 'puts $:'

とします。

$LOAD_PATH の特異メソッドとして resolve_feature_path が定義されています。
require を呼んだときに読み込まれるファイルを特定できます。

//emlist[][ruby]{
p $LOAD_PATH.resolve_feature_path('set')
# => [:rb, "/b...

絞り込み条件を変える

Kernel$$: -> [String] (123.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...
...には

$ ruby -e 'puts $:'

とします。

$LOAD_PATH の特異メソッドとして resolve_feature_path が定義されています。
require を呼んだときに読み込まれるファイルを特定できます。

//emlist[][ruby]{
p $LOAD_PATH.resolve_feature_path('set')
# => [:rb, "/b...

Kernel$$-I -> [String] (111.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...

Kernel$$: -> [String] (111.0)

Rubyライブラリをロードするときの検索パスです。

...Rubyライブラリをロードするときの検索パスです。

Kernel
.#load Kernel.#require
がファイルをロードする時に検索するディレクトリのリストを含む配列です。

起動時にはコマンドラインオプション -I で指定したディレクトリ、...