48件ヒット
[1-48件を表示]
(0.051秒)
ライブラリ
- ビルトイン (24)
-
webrick
/ httpresponse (24)
クラス
- Module (24)
-
WEBrick
:: HTTPResponse (24)
キーワード
- <=> (12)
-
const
_ source _ location (12) -
content
_ length (12) -
content
_ length= (12)
検索結果
先頭4件
-
Module
# const _ source _ location(name , inherited = true) -> [String , Integer] (120.0) -
name で指定した定数の定義を含むソースコードのファイル名と行番号を配列で返します。
...します。
@param name Symbol,String で定数の名前を指定します。
@param inherited true を指定するとスーパークラスや include したモジュールで定義された定数が対象にはなります。false を指定した場合 対象にはなりません。
@return ソ......//emlist[例][ruby]{
# test.rb:
class A # line 1
C1 = 1
C2 = 2
end
module M # line 6
C3 = 3
end
class B < A # line 10
include M
C4 = 4
end
class A # 継続して A を定義する
C2 = 8 # 定数を再定義する
end
p B.const_source_location('C4') # =>......# => ["test.rb", 7]
p B.const_source_location('C1') # => ["test.rb", 2]
p B.const_source_location('C3', false) # => nil -- include したモジュールは検索しない
p A.const_source_location('C2') # => ["test.rb", 16] -- 最後に定義された位置を返... -
Module
# <=>(other) -> Integer | nil (108.0) -
self と other の継承関係を比較します。
...ルでなければ
nil を返します。
@param other 比較対象のクラスやモジュール
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1
p Baz <=> Foo # => -1
p Baz <=> Qux # => n... -
WEBrick
:: HTTPResponse # content _ length -> Integer | nil (108.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...まれません。
@param len ヘッダの値を整数で指定します。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... -
WEBrick
:: HTTPResponse # content _ length=(len) (8.0) -
Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。
...まれません。
@param len ヘッダの値を整数で指定します。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...