るりまサーチ

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

別のキーワード

  1. socket pf_local
  2. socket af_local
  3. socket local_creds
  4. socket local_connwait
  5. socket local_peercred

クラス

モジュール

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

Time.local(year, mon = 1, day = 1, hour = 0, min = 0, sec = 0, usec = 0) -> Time (18110.0)

引数で指定した地方時の Time オブジェクトを返します。

...字列で指定します。(60はうるう秒)

@param usec マイクロ秒を整数か文字列で指定します。

@raise ArgumentError 与えられた引数の範囲が valid でない場合に発生します。

//emlist[][ruby]{
p Time.local(2000, 1, 1) # => 2000-01-01 00:00:00 +0900
//}...

Time.local(sec, min, hour, mday, mon, year, wday, yday, isdst, zone) -> Time (18105.0)

引数で指定した地方時の Time オブジェクトを返します。

引数で指定した地方時の Time オブジェクトを返します。

引数の順序は Time#to_a と全く同じです。
引数 wday, yday, zone に指定した値は無視されます。
引数に nil を指定した場合の値はその引数がとり得る最小の値です。

@param sec 秒を 0 から 60 までの整数か文字列で指定します。(60はうるう秒)

@param min 分を 0 から 59 までの整数か文字列で指定します。

@param hour 時を 0 から 23 までの整数か文字列で指定します。

@param mday 日を 1 から 31 までの整数か文字列で指定しま...

Binding#local_variable_set(symbol, obj) (6151.0)

引数 symbol で指定した名前のローカル変数に引数 obj を設定します。

...a = 1
bind = binding
bind.local_variable_set(:a, 2) # set existing local variable `a'
bind.local_variable_set(:b, 3) # create new local variable `b'
# `b' exists only in binding
p bind.local_variable_get(:a) # => 2
p bind.local_variable_get(:b) # => 3
p...
...# => NameError
end
//}

このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。

//emlist[][ruby]{
binding.eval("#{symbol} = #{obj}")
//}

@see Binding#local_variable_get, Binding#local_variable_defined?...

Binding#local_variable_defined?(symbol) -> bool (6133.0)

引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。

...binding.local_variable_defined?(:a) # => true
binding.local_variable_defined?(:b) # => false
end
//}

このメソッドは以下のコードの短縮形です。

//emlist[][ruby]{
binding.eval("defined?(#{symbol}) == 'local-variable'")
//}

@see Binding#local_variable_get, Binding#local_variabl...

Binding#local_variable_get(symbol) -> object (6127.0)

引数 symbol で指定した名前のローカル変数に設定された値を返します。

...][ruby]{
def foo
a = 1
binding.local_variable_get(:a) # => 1
binding.local_variable_get(:b) # => NameError
end
//}

このメソッドは以下のコードの短縮形です。

//emlist[][ruby]{
binding.eval("#{symbol}")
//}

@see Binding#local_variable_set, Binding#local_variable_defined?...

絞り込み条件を変える

Binding#local_variables -> [Symbol] (6115.0)

ローカル変数の一覧を Symbol の配列で返します。

...カル変数の一覧を Symbol の配列で返します。

//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
binding.local_variables #=> [:a, :n]
end
end
//}

このメソッドは以下のコードと同様の動作をします。

//emlist[][ruby]{
binding.eval("local_variables")
//}...

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

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

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

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

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

NameError#local_variables -> [Symbol] (6109.0)

self が発生した時に定義されていたローカル変数名の一覧を返します。

...発生した時に定義されていたローカル変数名の一覧を返します。

内部での使用に限ります。

例:

def foo
begin
b = "bar"
c = 123
d
rescue NameError => err
p err.local_variables #=> [:b, :c, :err]
end
end

a = "buz"
foo...

Encoding.locale_charmap -> String | nil (6102.0)

ロケールエンコーディングを決定するために用いる、locale charmap 名を返します。nl_langinfo 等がない環境では nil を、miniruby では ASCII_8BIT を返します。

...用いる、locale charmap 名を返します。nl_langinfo 等がない環境では nil を、miniruby では ASCII_8BIT を返します。

//emlist[Debian GNU/Linux + LANG=C][ruby]{
Encoding.locale_charmap #=> "ANSI_X3.4-1968"
//}

//emlist[LANG=ja_JP.EUC-JP][ruby]{
Encoding.locale_charmap #=> "E...
...UC-JP"
//}

//emlist[SunOS 5 + LANG=C][ruby]{
Encoding.locale_charmap #=> "646"
//}

//emlist[SunOS 5 + LANG=ja][ruby]{
Encoding.locale_charmap #=> "eucJP"
//}

@see charmap(5)...

Time#getlocal -> Time (6102.0)

タイムゾーンを地方時に設定した Time オブジェクトを新しく生成 して返します。

...01 20:15:01 UTC
p t.utc? # => true
p l = t.getlocal # => 2000-01-02 05:15:01 +0900
p l.utc? # => false
p t == l # => true
p j = t.getlocal("+09:00") # => 2000-01-02 05:15:01 +0900
p j.utc?...

絞り込み条件を変える

<< 1 2 3 ... > >>