48件ヒット
[1-48件を表示]
(0.128秒)
別のキーワード
キーワード
-
class
_ variables (12) -
connect
_ nonblock (12) - flock (12)
検索結果
先頭4件
-
Module
# constants(inherit = true) -> [Symbol] (18168.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 (19.0) -
ファイルをロックします。
...ロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すようになります。
@param operation ロックに対する操作の種類を示す定数を指定します。
どのような定数が利用可能かは以......に発生します。
引数 operation に有効な定数は以下の通りです。定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::LOCK_SH などとして参... -
Module
# class _ variables(inherit = true) -> [Symbol] (19.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 (13.0) -
ソケットをノンブロッキングモードに設定した後、 connect(2) を呼び出します。
...nnect_nonblock をリトライするために使うことができます。
# Pull down Google's web page
require 'socket'
include Socket::Constants
socket = Socket.new(AF_INET, SOCK_STREAM, 0)
sockaddr = Socket.sockaddr_in(80, 'www.google.com')
begin # emulate blocking connect
sock......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...