るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.202秒)
トップページ > クエリ:ArgumentError[x] > クエリ:クラス/メソッドの定義[x]

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document clone
  4. rexml/document to_s
  5. rexml/document node_type

検索結果

クラス/メソッドの定義 (15037.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...クラス/メソッドの定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* d...
...ef foo(x, y = 1) # 2番目の引数yにデフォルト値を指定
10 * x + y
end
p foo(1, 5) #=> 15
p foo(3) #=> 31
p foo #=> ArgumentError (wrong number of arguments)
//}

デフォルト値を指定する引数の位置は、1つの連続した区間になっている必要があ...

ruby 1.6 feature (60.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...$; が有効にな
るのは引数省略時だけでした。

$; = ":"
p "a:b:c".split(nil)
=> -:2:in `split': bad separator (ArgumentError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]

=> ruby 1.6.7 (2002-07-30) [i586-linux]
["a", "b", "c"]

: 2002-06...
...0 を指定したと見なされエラーになって
いました。

1.step(2, 0.1) {|f| p f }

=> -:1:in `step': step cannot be 0 (ArgumentError)
from -:1
ruby 1.6.7 (2002-03-01) [i586-linux]

=> ruby 1.6.7 (2002-04-10) [i586-linux]
1
1.1
:...
...p Marshal.dump(Object.new).unpack("CC").join(".")
=> ruby 1.6.4 (2001-06-11) [i586-linux]
"4.6"

: $SAFE / ((<クラス/メソッドの定義/def>))

doc/NEWS には

Fixed so defining a new method is allowed under $SAFE == 4, which
previously wasn't.

とある...

1.6.8から1.8.0への変更点(まとめ) (36.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...い。break が例外になる。

Proc.new {|a,b,c| p [a,b,c]}.call(1,2)
=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]...
...=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]
=> -:1: wrong number of arguments (2 for 3) (ArgumentError)
from -:1:in `...
...(C の do ... while 構文と同じ)をしていませんでした。
((<ruby-list:34618>))

: ((<"rescue/ensure on class/module"|クラス/メソッドの定義/クラス定義>)) [compat]

メソッド定義のほかにもクラス定義やモジュール定義にもrescue/ensureを
つけ...