るりまサーチ (Ruby 2.7.0)

最速Rubyリファレンスマニュアル検索!
6件ヒット [1-6件を表示] (0.036秒)
トップページ > バージョン:2.7.0[x] > クエリ:String[x] > クエリ:load[x] > モジュール:Kernel[x]

別のキーワード

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

種類

ライブラリ

キーワード

検索結果

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

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

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

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

autoload 設定されていないか、ロード済みなら nil を返し...
...lass 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 (18322.0)

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

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

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

const_name が aut...
...対象を指定します。
@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] (9670.0)

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

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

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

起動時にはコマンドラインオプション -I で指定したディレクトリ、...
...す。
require を呼んだときに読み込まれるファイルを特定できます。

//emlist[][ruby]{
p $LOAD_PATH.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.7.0/lib/ruby/2.7.0/set.rb"]
//}

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

@see spec/rubycmd, spec/envvars...

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

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

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

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

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

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

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

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

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

起動時にはコマンドラインオプション -I で指定したディレクトリ、...
...す。
require を呼んだときに読み込まれるファイルを特定できます。

//emlist[][ruby]{
p $LOAD_PATH.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.7.0/lib/ruby/2.7.0/set.rb"]
//}

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

@see spec/rubycmd, spec/envvars...

絞り込み条件を変える

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

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

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

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

起動時にはコマンドラインオプション -I で指定したディレクトリ、...
...す。
require を呼んだときに読み込まれるファイルを特定できます。

//emlist[][ruby]{
p $LOAD_PATH.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.7.0/lib/ruby/2.7.0/set.rb"]
//}

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

@see spec/rubycmd, spec/envvars...