るりまサーチ

最速Rubyリファレンスマニュアル検索!
52件ヒット [1-52件を表示] (0.008秒)
トップページ > クエリ:arguments[x] > 種類:特異メソッド[x]

別のキーワード

  1. command arguments
  2. buildcommand arguments
  3. dependencycommand arguments
  4. rubygems/command arguments
  5. configfile handle_arguments

ライブラリ

クラス

キーワード

検索結果

Rake::TaskArguments.new(names, values, parent = nil) (3043.0)

自身を初期化します。

...親となる Rake::TaskArguments を指定します。

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

task default: :test_rake_app
task :test_rake_app do
arguments
1 = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments
2 = Rake::TaskArguments.new(["name3", "name4"...
...], ["value3", "value4"], arguments1)
p arguments1 # => #<Rake::TaskArguments name1: value1, name2: value2>
p arguments2 # => #<Rake::TaskArguments name3: value3, name4: value4>
p arguments2["name1"] # => "value1"
p arguments2["name3"] # => "value3"
end
//}...

GetoptLong.new(*arguments) (108.0)

GetoptLong のオブジェクトを生成します。引数が与えられ たときは、それを GetoptLong#set_options メソッドに渡します。

...GetoptLong のオブジェクトを生成します。引数が与えられ
たときは、それを GetoptLong#set_options メソッドに渡します。

@param arguments オプションを定義するための配列の配列を指定します。

@see GetoptLong#set_options...

Data.[](**kwargs) -> Data (7.0)

(このメソッドは Data のサブクラスにのみ定義されています) 値オブジェクトを生成して返します。

...oint.new(1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(1, 2, 3) # => in `new': wrong number of arguments (given 3, expected 0..2) (ArgumentError)
Point.new(x: 1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(x: 1,...

Data.[](*args) -> Data (7.0)

(このメソッドは Data のサブクラスにのみ定義されています) 値オブジェクトを生成して返します。

...oint.new(1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(1, 2, 3) # => in `new': wrong number of arguments (given 3, expected 0..2) (ArgumentError)
Point.new(x: 1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(x: 1,...

Data.new(**kwargs) -> Data (7.0)

(このメソッドは Data のサブクラスにのみ定義されています) 値オブジェクトを生成して返します。

...oint.new(1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(1, 2, 3) # => in `new': wrong number of arguments (given 3, expected 0..2) (ArgumentError)
Point.new(x: 1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(x: 1,...

絞り込み条件を変える

Data.new(*args) -> Data (7.0)

(このメソッドは Data のサブクラスにのみ定義されています) 値オブジェクトを生成して返します。

...oint.new(1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(1, 2, 3) # => in `new': wrong number of arguments (given 3, expected 0..2) (ArgumentError)
Point.new(x: 1) # => in `initialize': missing keyword: :y (ArgumentError)
Point.new(x: 1,...

Struct.new(*args, keyword_init: nil) -> Class (7.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...= Struct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).

# keyword_init:...
...z: 3) # => ArgumentError (unknown keywords: z)

Point3 = Struct.new(:x, :y, keyword_init: true)
Point3.new(1, 2) # => wrong number of arguments (given 2, expected 0) (ArgumentError)
Point3.new(x: 1, y: 2) # => #<struct Point3 x=1, y=2>
Point3.new(x: 1) # => #<struct Poi...

Struct.new(*args, keyword_init: nil) {|subclass| block } -> Class (7.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...= Struct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).

# keyword_init:...
...z: 3) # => ArgumentError (unknown keywords: z)

Point3 = Struct.new(:x, :y, keyword_init: true)
Point3.new(1, 2) # => wrong number of arguments (given 2, expected 0) (ArgumentError)
Point3.new(x: 1, y: 2) # => #<struct Point3 x=1, y=2>
Point3.new(x: 1) # => #<struct Poi...

Struct.[](*args) -> Struct (2.0)

(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。

(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。

@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。

@return 構造体クラスのインスタンス。

@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。

//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}

Struct.new(*args) -> Struct (2.0)

(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。

(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。

@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。

@return 構造体クラスのインスタンス。

@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。

//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}

絞り込み条件を変える