6件ヒット
[1-6件を表示]
(0.036秒)
ライブラリ
- ビルトイン (6)
キーワード
-
$ -I (1) -
$ : (1) -
$ LOADED _ FEATURES (1) -
$ LOAD _ PATH (1) - autoload (1)
- autoload? (1)
検索結果
先頭5件
-
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...