種類
ライブラリ
クラス
- Array (646)
- BigDecimal (36)
- Complex (12)
- Data (6)
- Date (24)
- Enumerator (12)
-
Fiddle
:: Pointer (24) - File (18)
- Float (21)
- Integer (40)
- Module (72)
- Object (24)
-
OpenSSL
:: BN (48) - OpenStruct (12)
- Range (218)
- Rational (60)
- Regexp (12)
-
Socket
:: AncillaryData (36) -
Socket
:: Option (36) - String (12)
- StringIO (12)
- SystemCallError (36)
- UnboundMethod (12)
- Vector (14)
-
WIN32OLE
_ PARAM (12) -
WIN32OLE
_ VARIANT (12) -
Win32
:: Registry (60)
モジュール
- CMath (240)
- Enumerable (144)
- Kernel (175)
- Marshal (72)
- Math (324)
- ObjectSpace (48)
- Singleton (24)
キーワード
-
$ @ (12) -
$ SAFE (7) -
$ ~ (12) - & (12)
- * (24)
- ** (12)
- + (24)
- - (24)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- <= (12)
- <=> (12)
- =~ (24)
- > (12)
- >= (12)
- ArgumentError (12)
- Array (12)
-
Check
_ Type (12) - Float (12)
- Hash (12)
- Integer (24)
-
MAJOR
_ VERSION (12) -
MINOR
_ VERSION (12) - Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 5 . 0 (8) - NUM2INT (12)
- NUM2LONG (12)
- NUM2SHORT (12)
- NUM2UINT (12)
- NUM2ULONG (12)
- NUM2USHORT (12)
- Ruby プログラムの実行 (12)
- String (12)
- [] (48)
- []= (50)
-
_ load (12) -
absolute
_ path? (6) - acos (18)
- acos! (6)
- acosh (18)
- acosh! (6)
- asin (18)
- asin! (6)
- asinh (18)
- asinh! (6)
- at (12)
- atan (18)
- atan! (6)
- atan2 (18)
- atan2! (6)
- atanh (18)
- atanh! (6)
- begin (12)
- bind (12)
- bool (12)
- bsearch (48)
- cbrt (18)
- cbrt! (6)
- ceil (12)
- clone (12)
- cmp (12)
- coerce (24)
- combination (24)
- cos (18)
- cos! (6)
- cosh (18)
- cosh! (6)
-
count
_ nodes (12) -
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) - cycle (24)
- define (6)
-
define
_ method (48) -
delete
_ at (12) - dig (10)
- dump (24)
- dup (16)
- each (24)
- end (12)
- erf (12)
- erfc (12)
- exp (18)
- exp! (6)
- fail (36)
- feed (12)
- fetch (36)
- first (48)
- flatten (12)
- flatten! (12)
- floor (12)
- freeze (6)
- frexp (12)
- gamma (12)
- hypot (12)
-
initialize
_ copy (12) - insert (12)
- int (24)
- intersection (6)
-
ip
_ pktinfo (12) - join (24)
- last (48)
- ldexp (12)
- lgamma (12)
- linger (12)
- load (12)
- log (36)
- log! (12)
- log10 (18)
- log10! (6)
- log2 (18)
- log2! (6)
- max (94)
- min (94)
- mode (24)
- modifiable (12)
- new (60)
- overlap? (2)
- permutation (24)
- pop (24)
- pow (24)
- putc (12)
- raise (36)
-
rb
_ check _ convert _ type (12) -
rb
_ define _ class _ under (12) -
rb
_ singleton _ class (12) - read (12)
-
read
_ bin (12) -
read
_ i (12) -
read
_ s (12) -
repeated
_ combination (24) -
repeated
_ permutation (24) - replace (12)
- restore (12)
-
reverse
_ each (4) - rotate (12)
- rotate! (12)
- round (33)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 9 feature (12) - sample (48)
- shift (24)
- sin (18)
- sin! (6)
-
singleton
_ class (12) - sinh (18)
- sinh! (6)
- sort (24)
- sqrt (18)
- sqrt! (6)
- string= (12)
- sum (42)
- tan (18)
- tan! (6)
- tanh (18)
- tanh! (6)
-
to
_ i (12) -
to
_ ptr (12) - transpose (12)
- truncate (12)
-
try
_ convert (4) - ucmp (12)
-
unix
_ rights (12) - yaml (12)
- zip (24)
- | (12)
- クラス/メソッドの定義 (12)
- 制御構造 (12)
検索結果
先頭5件
-
TypeError (38000.0)
-
メソッドの引数に期待される型ではないオブジェクトや、期待される振る舞いを持たないオブジェクトが渡された時に発生します。
メソッドの引数に期待される型ではないオブジェクトや、期待される振る舞いを持たないオブジェクトが渡された時に発生します。
@see ArgumentError -
ruby 1
. 6 feature (78.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...[0].upcase!
p a
=> ruby 1.6.7 (2002-03-01) [i586-linux]
"KEY"
=> -:3:in `upcase!': can't modify frozen string (TypeError)
from -:3
ruby 1.6.7 (2002-08-01) [i586-linux]
: 2002-06-10 Fixnum#>>, <<
負の数に対して右シフトする......規則を
使用するようになりました。
p sprintf("%d", nil)
=> -:1:in `sprintf': no implicit conversion from nil (TypeError)
from -:1
ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby 1.6.7 (2002-07-30) [i586-linux]
"0"
: 2002......~ = nil
p $~
=> ruby 1.6.7 (2002-03-01) [i586-linux]
#<MatchData:0x401b1be4>
-:3: wrong argument type nil (expected Match) (TypeError)
^^^^^ MatchData の間違い
=> ruby 1.6.7 (2002-04-04) [i586-linux]
#<MatchData:0x401... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (54.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への変更点(まとめ)/サポートプラットフォームの追加>))
...<Array#[]=|Array/[]=>)) [compat]
配列のインデックスとして Symbol を指定した場合、Symbol#to_int を呼ば
す、例外 ((<TypeError>)) が発生するようになりました。
((<ruby-list:37217>))
: ((<Array/Array.new>)) [compat]
: ((<Array#fill|Array/fill>))......由です(ENVが返す文字列を変更しても環境変数自体に影響がない)。
=> -:2:in `sub!': can't modify frozen string (TypeError)
from -:2
ruby 1.8.0 (2003-06-09) [i586-linux]
=== Hash
: ((<Hash#update|Hash/update>)) [compat]
ブロックを......ん)。
$; の指定に正規表現が許されるようになりました。これに伴い、文字列以
外を設定しても例外 ((<TypeError>)) は発生しないようになりました。
((<ruby-talk:77381>))
: ((<String#center|String/center>)) [compat]
: ((<String#ljust|String/lj... -
Kernel
. # Integer(arg , base = 0) -> Integer (24.0) -
引数を整数 (Fixnum,Bignum) に変換した結果を返します。
...した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発......ger(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)
p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("010")... -
Kernel
. # Integer(arg , base = 0 , exception: true) -> Integer | nil (24.0) -
引数を整数 に変換した結果を返します。
...した場合に発生します。
@raise TypeError メソッド to_int, to_i を持たないオブジェクトを引数に指定したか、to_int, to_i
が整数(Integerのサブクラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発......ger(4_000) #=> 4000
p Integer(9.88) #=> 9
p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)
p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("010")... -
Kernel
. # Float(arg) -> Float (18.0) -
引数を浮動小数点数(Float)に変換した結果を返します。
...です。
@raise ArgumentError 整数や浮動小数点数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError nil またはメソッド to_f を持たないオブジェクトを引数に指定したか、
to_f が浮動小数点数を返......#=> 9.88
p Float(Time.gm(1986)) #=> 504921600.0
p Float(Object.new) # can't convert Object into Float (TypeError)
p Float(nil) # can't convert nil into Float (TypeError)
p Float("10") #=> 10.0
p Float("10e2") #=> 1000.0
p Float("1e-2") #=> 0.01
p Float(".1")... -
Kernel
. # Float(arg , exception: true) -> Float | nil (18.0) -
引数を浮動小数点数(Float)に変換した結果を返します。
...ます。
@raise ArgumentError 整数や浮動小数点数と見なせない文字列を引数に指定した場合に発生します。
@raise TypeError nil またはメソッド to_f を持たないオブジェクトを引数に指定したか、
to_f が浮動小数点数を返......#=> 9.88
p Float(Time.gm(1986)) #=> 504921600.0
p Float(Object.new) # can't convert Object into Float (TypeError)
p Float(nil) # can't convert nil into Float (TypeError)
p Float("10") #=> 10.0
p Float("10e2") #=> 1000.0
p Float("1e-2") #=> 0.01
p Float(".1")... -
Marshal
. # dump(obj , limit = -1) -> String (18.0) -
obj を指定された出力先に再帰的に出力します。
...力先に再帰的に出力します。
ファイルに書き出せないオブジェクトをファイルに書き出そうとすると
例外 TypeError が発生します。
ファイルに書き出せないオブジェクトは以下の通りです。
* 名前のついてない Class/Module......指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param obj ダンプする対象のオブジェクトを指定......n port を省略すると、obj をダンプした String を返します。
port を指定すると port を返します。
@raise TypeError ファイルに書き出せないオブジェクトをファイルに
書きだそうとした場合に発生します。
@rai... -
Marshal
. # dump(obj , port , limit = -1) -> IO (18.0) -
obj を指定された出力先に再帰的に出力します。
...力先に再帰的に出力します。
ファイルに書き出せないオブジェクトをファイルに書き出そうとすると
例外 TypeError が発生します。
ファイルに書き出せないオブジェクトは以下の通りです。
* 名前のついてない Class/Module......指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param obj ダンプする対象のオブジェクトを指定......n port を省略すると、obj をダンプした String を返します。
port を指定すると port を返します。
@raise TypeError ファイルに書き出せないオブジェクトをファイルに
書きだそうとした場合に発生します。
@rai... -
Ruby プログラムの実行 (18.0)
-
Ruby プログラムの実行 === Ruby プログラム
...外 TypeError が発生します。
クラスを得たら次にそれを定数「ClassName」に代入します。これによってク
ラス名が決定されます。このとき同名の定数に Class のインスタンスでない
ものが代入されている場合は例外 TypeError が発......定数が
モジュールの名前になります。このとき同名の定数にモジュール以外が代入
されていた場合は例外 TypeError が発生します。
最後に、新しいフレームを生成し、そのトップレベルブロックの self および
class にモジュ... -
ruby 1
. 8 . 2 feature (18.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...1 -e 'p [nil].pack("L")'
"\000\000\000\000"
$ ruby-1.8.2 -e 'p [nil].pack("L")'
-e:1:in `pack': cannot convert nil into Integer (TypeError)
from -e:1
$ ruby-1.8.2 -e 'p [nil].pack("P")'
"\000\000\000\000"
=== 2004-10-27
: CGI [lib] [bug]
無限ループに陥......ラスを再定義した時 TypeError を投げるようになりました。
((<ruby-list:39567>))
$ ruby-1.8.2 -e '
class Foo
Bar = 1
end
class Foo < String
Baz = 2
end
'
-e:6: superclass mismatch for class Foo (TypeError)
=== 2004-04-19
: Hash#==...