るりまサーチ

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

別のキーワード

  1. net/imap param
  2. win32ole win32ole_param
  3. win32ole_param output?
  4. bodytypetext param
  5. win32ole_param to_s

ライブラリ

クラス

キーワード

検索結果

Module#constants(inherit = true) -> [Symbol] (18280.0)

そのモジュール(またはクラス)で定義されている定数名の配列を返します。

...ラスで定義されている
定数は含まれません。 Object.constants とすると Object クラスで定義された
定数の配列が得られます。

得られる定数の順序は保証されません。

@param inherit true を指定するとスーパークラスや include した...
...dule.constants, Kernel.#local_variables, Kernel.#global_variables, Object#instance_variables, Module#class_variables

//emlist[Module.constants と Module#constants の違い][ruby]{
# 出力の簡略化のため起動時の定数一覧を取得して後で差し引く
$clist = Module.constants

cla...
...s Bar
BAR = 1

# Bar は BAR を含む
p constants # => [:BAR]
# 出力に FOO は含まれない
p Module.constants - $clist # => [:BAR, :Bar, :Foo]
class Baz
# Baz は定数を含まない
p constants # => []

# ネス...

File#flock(operation) -> 0 | false (131.0)

ファイルをロックします。

...ロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すようになります。

@param operation ロックに対する操作の種類を示す定数を指定します。
どのような定数が利用可能かは以...
...に発生します。

引数 operation に有効な定数は以下の通りです。定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::LOCK_SH などとして参...
...:LOCK_UN)
puts "unlocked by process1"
sleep 1 # <- 子プロセスが確実に先にロックするための sleep
f.flock(File::LOCK_EX)
puts "re-locked by process1"

# => locked by process1
# unlocked by process1
# locked by process2
# unlocked by process2
# re-locked by process1
//}...

Module#class_variables(inherit = true) -> [Symbol] (119.0)

クラス/モジュールに定義されているクラス変数の名前の配列を返します。

...クラス/モジュールに定義されているクラス変数の名前の配列を返します。

@param inherit false を指定しない場合はスーパークラスやインクルードして
いるモジュールのクラス変数を含みます。

//emlist[例][ruby]{
class One...
...d
class Two < One
@@var2 = 2
end
One.class_variables # => [:@@var1]
Two.class_variables # => [:@@var2, :@@var1]
Two.class_variables(false) # => [:@@var2]
//}

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

Socket#connect_nonblock(server_sockaddr) -> 0 (119.0)

ソケットをノンブロッキングモードに設定した後、 connect(2) を呼び出します。

...socket'
include Socket::Constants
socket = Socket.new(AF_INET, SOCK_STREAM, 0)
sockaddr = Socket.sockaddr_in(80, 'www.google.com')
begin # emulate blocking connect
socket.connect_nonblock(sockaddr)
rescue IO::WaitWritable
IO.select(nil, [socket]) # wait 3-way handshake completion...
...k(sockaddr) # check connection failure
rescue Errno::EISCONN
end
end
socket.write("GET / HTTP/1.0\r\n\r\n")
results = socket.read



@param server_sockaddr 接続先アドレス
@raise Errno::EXXX connect(2) がエラーを報告した場合に発生します。詳しくは
man...