67件ヒット
[1-67件を表示]
(0.103秒)
ライブラリ
- ビルトイン (19)
- erb (12)
-
rubygems
/ specification (12) - socket (24)
キーワード
- bindir (12)
-
instance
_ method (12) -
recvfrom
_ nonblock (12) - result (12)
-
source
_ location (7)
検索結果
先頭5件
-
Socket
# bind(my _ sockaddr) -> 0 (24224.0) -
ソケットを my_sockaddr に結合します。bind(2) と同じ働きをします。
...ソケットを my_sockaddr に結合します。bind(2)
と同じ働きをします。
@param my_sockaddr ソケットアドレス構造体を pack した文字列lib:socket#pack_stringもしくはAddrinfoオブジェクトを指定します。
@return 0 を返します。... -
Gem
:: Specification # bindir -> String (12302.0) -
実行ファイルを格納するディレクトリを返します。
実行ファイルを格納するディレクトリを返します。 -
UDPSocket
# recvfrom _ nonblock(maxlen , flags=0) -> [String , Array] (6214.0) -
ソケットをノンブロッキングモードに設定した後、 recvfrom(2) でソケットからデータを受け取ります。
...ータを受け取ります。
maxlen で受け取るデータの最大バイト数を指定します。
flags はフラグで、Socket::MSG_* の bitwise OR を渡します。
詳しくは recvfrom(2) を参照してください。
返り値はデータの文字列と送り元のアドレス情......Errno::EWOULDBLOCK、Errno::EAGAIN のような待ってからリトライすることが
可能であることを意味する例外には、IO::WaitReadable が extend
されています。
require 'socket'
s1 = UDPSocket.new
s1.bind("127.0.0.1", 0)
s2 = UDPSocket.new
s2.bind("127.0.0.1"......s_at(3,1))
s1.connect(*s2.addr.values_at(3,1))
s1.send "aaa", 0
begin # emulate blocking recvfrom
p s2.recvfrom_nonblock(10)
#=> ["aaa", ["AF_INET", 33302, "localhost.localdomain", "127.0.0.1"]]
rescue IO::WaitReadable
IO.select([s2])
retry
end
@param maxlen 受け取る... -
Binding
# source _ location -> [String , Integer] (6102.0) -
self の Ruby のソースファイル名と行番号を返します。
...self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}... -
ERB
# result(b=TOPLEVEL _ BINDING) -> String (3325.0) -
ERB を b の binding で実行し、結果の文字列を返します。
...ERB を b の binding で実行し、結果の文字列を返します。
@param b eRubyスクリプトが実行されるときのbinding
//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
puts erb.result
# test foo
# test bar
//......}
@see ERB#result_with_hash... -
Module
# instance _ method(name) -> UnboundMethod (137.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...化した UnboundMethod を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
class Inte......d(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!
//}...