るりまサーチ

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

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

キーワード

検索結果

<< < ... 28 29 30 >>

Net::IMAP::BodyTypeMessage#body -> Net::IMAP::BodyTypeBasic | Net::IMAP::BodyTypeMessage | Net::IMAP::BodyTypeText | Net::IMAP::BodyTypeMultipart (201.0)

ボディを返します。

ボディを返します。

Net::HTTPHeader#main_type -> String|nil (139.0)

"text/html" における "text" のようなタイプを表す 文字列を返します。

..."text/html" における "text" のようなタイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP.get_r...
...esponse(uri)
res.main_type # => "text"
//}...

Net::HTTPHeader#content_type -> String|nil (117.0)

"text/html" のような Content-Type を表す 文字列を返します。

..."text/html" のような Content-Type を表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/comments.cgi?post=comment')
req = Net::HTTP::Post...
....new(uri.request_uri)
req.content_type # => nil
req.content_type = 'multipart/form-data'
req.content_type # => "multipart/form-data"
//}...

Net::HTTPHeader#sub_type -> String|nil (117.0)

"text/html" における "html" のようなサブタイプを表す 文字列を返します。

..."text/html" における "html" のようなサブタイプを表す
文字列を返します。

Content-Type: ヘッダフィールドが存在しない場合には nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
res = Net::HTTP...
....get_response(uri)
res.sub_type # => "html"
//}...

Method#<<(callable) -> Proc (113.0)

self と引数を合成した Proc を返します。

...self と引数を合成した Proc を返します。

戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を callable に渡して呼び出し、
その戻り値を self に渡して呼び出した結果を返します...
...なります。

@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。

//emlist[例][ruby]{
def f(x)
x * x
end

def g(x)
x + x
end

# (3 + 3) * (3 + 3)
p (method(:f) << method(:g)).call(3) # => 36
//}

//emlist[call を定義したオブジェ...
...を渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT


pipeline = method(:pp) << WordScanner << File.method(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Pro...

絞り込み条件を変える

Method#>>(callable) -> Proc (113.0)

self と引数を合成した Proc を返します。

...self と引数を合成した Proc を返します。

戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を self に渡して呼び出し、
その戻り値を callable に渡して呼び出した結果を返します...
...なります。

@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。

//emlist[例][ruby]{
def f(x)
x * x
end

def g(x)
x + x
end

# (3 * 3) + (3 * 3)
p (method(:f) >> method(:g)).call(3) # => 18
//}

//emlist[call を定義したオブジェ...
...を渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT


pipeline = File.method(:read) >> WordScanner >> method(:pp)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Pro...

OpenURI::Meta#charset -> String | nil (113.0)

対象となるリソースの文字コードを文字列で返します。Content-Type ヘッダの文字コード情報が使われます。 文字列は小文字へと変換されています。

...

Content-Type ヘッダがない場合は、nil を返します。ただし、ブロックが与えられている場合は、
その結果を返します。また対象となる URI のスキームが HTTP であり、自身のタイプが text である場合は、
2616 3.7.1 で定められ...
...ているとおり、文字列 "iso-8859-1" を返します。

//emlist[例][ruby]{
require 'open-uri'
open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"
p f.charset # => "iso-8859-1"
}
//}...
...ているとおり、文字列 "iso-8859-1" を返します。

//emlist[例][ruby]{
require 'open-uri'
URI.open("http://www.ruby-lang.org/en") {|f|
p f.content_type # => "text/html"
p f.charset # => "iso-8859-1"
}
//}...

Proc#<<(callable) -> Proc (113.0)

self と引数を合成した Proc を返します。

...self と引数を合成した Proc を返します。

戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を callable に渡して呼び出し、
その戻り値を self に渡して呼び出した結果を返します...
...aram callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。

//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }

# (3 + 3) * (3 + 3)
p (f << g).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class Wo...
...rdScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT


pipeline = proc { |data| puts "word count: #{data.size}" } << WordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}

@see Method#<<, Method#...

Proc#>>(callable) -> Proc (113.0)

self と引数を合成した Proc を返します。

...self と引数を合成した Proc を返します。

戻り値の Proc は可変長の引数を受け取ります。
戻り値の Proc を呼び出すと、まず受け取った引数を self に渡して呼び出し、
その戻り値を callable に渡して呼び出した結果を返します...
...aram callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。

//emlist[例][ruby]{
f = proc { |x| x * x }
g = proc { |x| x + x }

# (3 * 3) + (3 * 3)
p (f >> g).call(3) # => 18
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class Wo...
...rdScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT


pipeline = proc { |fname| File.read(fname) } >> WordScanner >> method(:p)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Method#<<, Method#...

ObjectSpace::WeakMap#[]=(key, value) (107.0)

引数 key から引数 value への参照を作成します。

...引数 key から引数 value への参照を作成します。

@param key 参照元のオブジェクトを指定します。

@param value 参照先のオブジェクトを指定します。

//emlist[例][ruby]{
weak_map = ObjectSpace::WeakMap.new
key = "text"
weak_map[key] = "test" # => test
w...

絞り込み条件を変える

PrettyPrint#first? -> bool (107.0)

このメソッドは obsolete です。

...は obsolete です。

現在のグループで first? に対する最初の呼び出しかどうかを判定する
述語です。これはカンマで区切られた値を整形するのに有用です。

pp.group(1, '[', ']') {
xxx.each {|yyy|
unless pp.first?
pp.text ','...
...pp.breakable
end
... pretty printing yyy ...
}
}...

WEBrick::HTTPResponse#content_type=(val) (107.0)

Content-Type ヘッダの値をセットします。

...Content-Type ヘッダの値をセットします。

@param val Content-Type ヘッダの値を文字列で指定します。

res.content_type = "text/html"

@see WEBrick::HTTPUtils.#mime_type...
<< < ... 28 29 30 >>