るりまサーチ

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

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. rexml/document to_a
  5. dbm to_a

検索結果

<< 1 2 > >>

Gem::Commands::DependencyCommand#arguments -> String (42302.0)

引数の説明を表す文字列を返します。

引数の説明を表す文字列を返します。

Gem::Commands::BuildCommand#arguments -> String (39302.0)

引数の説明を表す文字列を返します。

引数の説明を表す文字列を返します。

Gem::Command#arguments -> String (33302.0)

このメソッドはサブクラスで再定義されます。 コマンドが取る引数の説明を表示するために使用します。

このメソッドはサブクラスで再定義されます。
コマンドが取る引数の説明を表示するために使用します。

サブクラスで実装する場合は、一つの引数につき一行で、左揃えの文字列を返すようにしてください。

Gem::ConfigFile#handle_arguments(arg_list) (24402.0)

コマンドに渡された引数を処理します。

...コマンドに渡された引数を処理します。

@param arg_list コマンドに渡された引数の配列を指定します。...

Rake::TaskArguments#with_defaults(defaults) -> Hash (18425.0)

パラメータにデフォルト値をセットします。

...@param defaults デフォルト値として使用するキーと値を格納したハッシュを指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
arguments
= Rake::TaskArguments.new(["name1", "name2"], ["value1", "value...
...2"])
arguments
.to_hash # => {:name1=>"value1", :name2=>"value2"}
arguments
.with_defaults({ default_key: "default_value"}) # => {:default_key=>"default_value", :name1=>"value1", :name2=>"value2"}
arguments
.to_hash # =...
...> {:default_key=>"default_value", :name1=>"value1", :name2=>"value2"}
end
//}...

絞り込み条件を変える

Gem::Command#defaults_str -> String (15307.0)

このメソッドはサブクラスで再定義されます。 コマンドのオプションで使用するデフォルト値を表示するために使用する文字列を返します。

...このメソッドはサブクラスで再定義されます。
コマンドのオプションで使用するデフォルト値を表示するために使用する文字列を返します。

@see Gem::Command#arguments...

String#prepend(*arguments) -> String (12447.0)

複数の文字列を先頭に破壊的に追加します。

...列を先頭に破壊的に追加します。

@param arguments 追加したい文字列を指定します。

//emlist[例][ruby]{
a
= "!!!"
a
.prepend # => "!!!"
a
# => "!!!"

a
= "!!!"
a
.prepend "hello ", "world" # => "hello world!!!"
a
# => "hello world!!!"
//}...

String#prepend(other_str) -> String (12227.0)

文字列 other_str を先頭に破壊的に追加します。

...文字列 other_str を先頭に破壊的に追加します。

@param other_str 追加したい文字列を指定します。

//emlist[例][ruby]{
a
= "world"
a
.prepend("hello ") # => "hello world"
a
# => "hello world"
//}...

Module#ruby2_keywords(method_name, ...) -> nil (6397.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.

...en method names, marks the method as passing keywords through
a
normal argument splat. This should only be called on methods that
a
ccept 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
a
nother 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 throu...
...method to
other methods.

This should only be used for methods that delegate keywords to another
method, and only for 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 Rub...

GetoptLong#set_options(*arguments) -> self (6326.0)

あなたのプログラムで、認識させたいオプションをセットします。 個々のオプションは、オプション名と引数のフラグからなる配列でな ければいけません。

...-d) か長いオプ
ション (例: --debug) を表した文字列のいずれかでなければなり
ません。配列の中の一番左端のオプション名が、オプションの正式名
になります。配列中の引数のフラグは、GetoptLong::NO_ARGUMENT,
GetoptLong::REQUIRE_ARG...
...UMENT, GetoptLong::OPTIONAL_ARGUMENT
のいずれかでなくてはなりません。

オプションを設定できるのは、get, get_option, each,
each_option メソッドを呼び出す前だけです。これらのメソッドを
呼び出した後でオプションを設定しようとする...
...RuntimeError
例外が発生します。

@param arguments オプションを表す配列を指定します。

@raise ArgumentError 不正な引数が与えられるた場合、発生します。

parser.set_options(['-d', '--debug', GetoptLong::NO_ARGUMENT],
['--version'...

絞り込み条件を変える

Object#yield_self -> Enumerator (6307.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

..."my string".yield_self {|s| s.upcase } # => "MY STRING"
3.next.yield_self {|x| x**x }.to_s # => "256"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'
re...
...quire 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条件...
...にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...
...]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'...
...require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条...
...件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...
<< 1 2 > >>