55件ヒット
[1-55件を表示]
(0.093秒)
ライブラリ
- ビルトイン (22)
- stringio (11)
-
webrick
/ httpresponse (22)
クラス
- StringIO (11)
- Thread (22)
-
WEBrick
:: HTTPResponse (22)
キーワード
-
add
_ trace _ func (11) -
content
_ length (11) -
content
_ length= (11) -
set
_ trace _ func (11) - write (11)
検索結果
先頭5件
-
StringIO
# write(*obj) -> Integer (124.0) -
自身に obj を書き込みます。obj が文字列でなければ to_s による文字列化を試みます。 書き込まれた文字列の長さを返します。
...自身に obj を書き込みます。obj が文字列でなければ to_s による文字列化を試みます。
書き込まれた文字列の長さを返します。
全ての出力メソッドは、最終的に「write」という名のメソッドを呼び出すので、
このメソッド......ram obj 書き込みたいオブジェクトを指定します。
@raise IOError 自身が書き込み可能でない時に発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge", 'r+')
a.write("aaa") #=> 3
a.string #=> "aaae"
//}... -
StringIO
# write(obj) -> Integer (124.0) -
自身に obj を書き込みます。obj が文字列でなければ to_s による文字列化を試みます。 書き込まれた文字列の長さを返します。
...自身に obj を書き込みます。obj が文字列でなければ to_s による文字列化を試みます。
書き込まれた文字列の長さを返します。
全ての出力メソッドは、最終的に「write」という名のメソッドを呼び出すので、
このメソッド......ram obj 書き込みたいオブジェクトを指定します。
@raise IOError 自身が書き込み可能でない時に発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge", 'r+')
a.write("aaa") #=> 3
a.string #=> "aaae"
//}... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (120.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...ることは出来ません。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12... -
Thread
# set _ trace _ func(pr) -> Proc | nil (43.0) -
スレッドにトレース用ハンドラを設定します。
...レースを解除します。
設定したハンドラを返します。
//emlist[例][ruby]{
th = Thread.new do
class Trace
end
2.to_s
Thread.current.set_trace_func nil
3.to_s
end
th.set_trace_func lambda {|*arg| p arg }
th.join
# => ["line", "example.rb", 2, nil, #<Binding:0x00007fc8......ple.rb", 4, nil, #<Binding:0x00007fc8de88c440>, nil]
# => ["c-call", "example.rb", 4, :to_s, #<Binding:0x00007fc8de896f30>, Integer]
# => ["c-return", "example.rb", 4, :to_s, #<Binding:0x00007fc8de894a50>, Integer]
# => ["line", "example.rb", 5, nil, #<Binding:0x00007fc8de967b08>, nil]
# => ["c-call... -
Thread
# add _ trace _ func(pr) -> Proc (37.0) -
スレッドにトレース用ハンドラを追加します。
...したハンドラを返します。
@param pr トレースハンドラ(Proc オブジェクト)
//emlist[例][ruby]{
th = Thread.new do
class Trace
end
43.to_s
end
th.add_trace_func lambda {|*arg| p arg }
th.join
# => ["line", "example.rb", 4, nil, #<Binding:0x00007f98e107d0d8>, nil]
# =>......e0>, nil]
# => ["line", "example.rb", 6, nil, #<Binding:0x00007f98e108d4b0>, nil]
# => ["c-call", "example.rb", 6, :to_s, #<Binding:0x00007f98e1097aa0>, Integer]
# => ["c-return", "example.rb", 6, :to_s, #<Binding:0x00007f98e1095cc8>, Integer]
//}
@see Thread#set_trace_func Kernel.#set_trace_func... -
WEBrick
:: HTTPResponse # content _ length=(len) (20.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...ることは出来ません。
require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s
#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12...