るりまサーチ

最速Rubyリファレンスマニュアル検索!
986件ヒット [901-986件を表示] (0.218秒)
トップページ > クエリ:object[x] > クエリ:>[x] > 種類:モジュール関数[x]

別のキーワード

  1. objectspace each_object
  2. _builtin each_object
  3. object send
  4. object to_enum
  5. json object

ライブラリ

モジュール

検索結果

<< < ... 8 9 10 >>

Kernel.#global_variables -> [Symbol] (107.0)

プログラム中で定義されているグローバル変数(`$'で始まる変数)名の 配列を返します。

...グラム中で定義されているグローバル変数(`$'で始まる変数)名の
配列を返します。

//emlist[例][ruby]{
p global_variables #=> [:$;, :$-F, :$@, ... ]
//}

@see Kernel.#local_variables,Object#instance_variables,Module.constants,Module#constants,Module#class_variables...

Kernel.#local_variables -> [Symbol] (107.0)

現在のスコープで定義されているローカル変数名の配列を返します。

...現在のスコープで定義されているローカル変数名の配列を返します。

//emlist[例][ruby]{
yuyu = 0
p local_variables #=> [:yuyu]
//}

@see Kernel.#global_variables,Object#instance_variables,Module.constants,Module#constants,Module#class_variables...

FileUtils.#cd(dir, options = {}) -> 0 (103.0)

プロセスのカレントディレクトリを dir に変更します。

プロセスのカレントディレクトリを dir に変更します。

ブロックとともに呼び出された時はブロック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}

FileUtils.#chdir(dir, options = {}) -> 0 (103.0)

プロセスのカレントディレクトリを dir に変更します。

プロセスのカレントディレクトリを dir に変更します。

ブロックとともに呼び出された時はブロック終了後に
元のディレクトリに戻ります。

@param dir ディレクトリを指定します。

@param options :verbose が指定できます。
c:FileUtils#options

//emlist[][ruby]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}

Kernel.#loop -> Enumerator (102.0)

(中断されない限り)永遠にブロックの評価を繰り返します。 ブロックが指定されなければ、代わりに Enumerator を返します。

(中断されない限り)永遠にブロックの評価を繰り返します。
ブロックが指定されなければ、代わりに Enumerator を返します。

//emlist[例][ruby]{
loop do
print "Input: "
line = gets
break if !line or line =~ /^qQ/
# ...
end
//}

与えられたブロック内で StopIteration を Kernel.#raise すると
ループを終了して nil を返します。
ループを終了させる場合、通常は break を使用してください。

@return break の引数など、ループ...
...
ループを終了させる場合、通常は break を使用してください。

//emlist[例][ruby]{
enum = Enumerator.new { |y|
y << "one"
y << "two"
:ok
}

result = loop {
puts enum.next
} # => :ok
//}


@return break の引数など、ループ脱出時の値を返します。...

絞り込み条件を変える

Kernel.#open(file, mode_enc = "r", perm = 0666) -> IO (102.0)

file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。

file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。

ブロックが与えられた場合、指定されたファイルをオープンし、
生成した IO オブジェクトを引数としてブロックを実行します。
ブロックの終了時や例外によりブロックを脱出するとき、
ファイルをクローズします。ブロックを評価した結果を返します。

ファイル名 file が `|' で始まる時には続く文字列をコマンドとして起動し、
コマンドの標準入出力に対してパイプラインを生成します

ファイル名が "|-" である時、open は Ruby の子プロセス
を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を...

Kernel.#open(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO | Tempfile | IO (102.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...ブクラスが発生します。詳しくは net/ftp
を参照して下さい。

例:

require 'open-uri'
sio = open('http://www.example.com') { |sio|
p sio.is_a?(OpenURI::Meta) # => true
p sio.content_type
puts sio.read
}

@see OpenURI.open_uri, URI.open...
...開くときにwarningが表示されるようになりました。

require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or use URI#open

@param name オープンしたいリソースを文...

Process::GID.#switch -> Integer (102.0)

実効グループ ID を一時的に変更するために使います。

...ソッドが現在のプラットフォームで実装されていない場合に発生します。

include Process
# (r, e, s) == (500, 505, 505)
p [gid, egid] #=> [500, 505]
Process::GID.switch do
p [gid, egid] #=> [500, 500]
end
p [gid, egid] #=> [500, 505]...

Process::UID.#switch -> Integer (102.0)

実効ユーザ ID を一時的に変更するために使います。

...ソッドが現在のプラットフォームで実装されていない場合に発生します。

include Process
# (r, e, s) == (500, 505, 505)
p [uid, euid] #=> [500, 505]
Process::UID.switch do
p [uid, euid] #=> [500, 500]
end
p [uid, euid] #=> [500, 505]...
<< < ... 8 9 10 >>