るりまサーチ

最速Rubyリファレンスマニュアル検索!
248件ヒット [201-248件を表示] (0.090秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:using[x]

別のキーワード

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

ライブラリ

クラス

モジュール

オブジェクト

キーワード

検索結果

<< < 1 2 3 >>

Net::HTTP#request_get(path, header = nil) {|response| .... } -> Net::HTTPResponse (212.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...します。
Net::HTTPResponse オブジェクトを返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロ...
...TP ヘッダをハッシュで指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response...

Net::HTTP#request_post(path, data, header = nil) -> Net::HTTPResponse (212.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

...す。
返り値は Net::HTTPResponse のインスタンスです。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロ...
...ダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデ...
...post2 は時代遅れなので使わないでください。

//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read

# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|resp...

Net::HTTP#request_post(path, data, header = nil) {|response| .... } -> Net::HTTPResponse (212.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

...す。
返り値は Net::HTTPResponse のインスタンスです。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という
形のハッシュでなければいけません。

ブロ...
...ダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデ...
...post2 は時代遅れなので使わないでください。

//emlist[例][ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read

# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|resp...

Net::HTTP#post(path, data, header = nil, dest = nil) -> Net::HTTPResponse (206.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...ダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
...
...ィ] となります。

//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-...

Net::HTTP#post(path, data, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (206.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...ダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

dest は時代遅れの引数です。利用しないでください。
dest を指定した場合には
...
...ィ] となります。

//emlist[例][ruby]{
# net/http version 1.1
response, body = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# version 1.2
response = http.post('/cgi-bin/search.rb', 'query=subject&target=ruby')

# using block
File.open('save.html', 'w') {|f|
http.post('/cgi-...

絞り込み条件を変える

Refinement#import_methods(*modules) -> self (206.0)

モジュールからメソッドをインポートします。

...モジュールからメソッドをインポートします。

Module#includeと違って、import_methods はメソッドをコピーして
refinement に追加して、refinementでインポートしたメソッドを有効化します。

メソッドをコピーするため、Rubyコードで...
...てください。

//emlist[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end

module M
refine String do
import_methods StrUtils
end
end

using
M
p "foo".indent(3) # => " foo"

module M
refine String do
import_methods Enumerable
# Can't import method...
...which is not defined with Ruby code: Enumerable#drop
end
end
//}...
<< < 1 2 3 >>