るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 > >>

OptionParser#accept(klass, pat = /.*/) {|str| ...} -> () (18236.0)

OptionParser.accept と同様ですが、 登録したブロックはレシーバーに限定されます。

...Parser.accept と同様ですが、
登録したブロックはレシーバーに限定されます。

@param klass クラスオブジェクトを与えます。

@param pat match メソッドを持ったオブジェクト(Regexp オブジェクトなど)を与えます。

//emlist[例][ruby]{
req...
...uire "optparse"
require "time"

opts = OptionParser.new
opts.accept(Time) do |s,|
begin
Time.parse(s) if s
rescue
raise OptionParser::InvalidArgument, s
end
end

opts.on("-t", "--time [TIME]", Time) do |time|
p time.class # => Time
end

opts.parse!(ARGV)
//}...

Module#ruby2_keywords(method_name, ...) -> nil (12285.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...al argument splat. This should only be called on methods that
accept
an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the final hash argument is marked with a special
flag such that if it is the...
...argument splat to
another method call, and that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.

This should only be used for methods that delegate keywords t...
...ackwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that if this met...

Proc#ruby2_keywords -> proc (12285.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

...ormal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked with a special flag such that if it is the fina...
...l argument splat to another method call, and that
method call does not include explicit keywords or a keyword splat, the
final element is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods.

This should only be used for procs that delegate keywords to...
...backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this meth...

Net::HTTP#post2(path, data, header = nil) -> Net::HTTPResponse (219.0)

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '...
...し header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデータを与えます。
@param header リクエストの HTTP...
...ださい。

//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...') {|response|
p response.status
p response['content-ty...

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '...
...し header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデータを与えます。
@param header リクエストの HTTP...
...ださい。

//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...') {|response|
p response.status
p response['content-ty...

絞り込み条件を変える

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '...
...し header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデータを与えます。
@param header リクエストの HTTP...
...ださい。

//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...') {|response|
p response.status
p response['content-ty...

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

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

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

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '...
...し header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

@param path POST先のエンティティのパスを文字列で指定します。
@param data POSTするデータを与えます。
@param header リクエストの HTTP...
...ださい。

//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...') {|response|
p response.status
p response['content-ty...

OptionParser#on(long, pat = /.*/, desc = "") {|v| ...} -> self (162.0)

オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

...自身に登録します。
ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

pat にはオプションの引数に許すパターンを表す正規表現で与えます。
コマンドに与えられた引数がパターンにマ...
...0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error

@param short ショートオプションを表す文字列を指定します。

@param long ロングオプションを表す文字列を指定します。

@param pat オプションの引...

OptionParser#on(short, long, pat = /.*/, desc = "") {|v| ...} -> self (162.0)

オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

...自身に登録します。
ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。

pat にはオプションの引数に許すパターンを表す正規表現で与えます。
コマンドに与えられた引数がパターンにマ...
...0-9_]+/){|name| ...}
# ruby command --username=ruby_user
# ruby command --username=ruby.user #=> Error

@param short ショートオプションを表す文字列を指定します。

@param long ロングオプションを表す文字列を指定します。

@param pat オプションの引...
<< 1 2 3 > >>