るりまサーチ

最速Rubyリファレンスマニュアル検索!
406件ヒット [1-100件を表示] (0.124秒)
トップページ > クエリ:i[x] > クエリ:UNDEFINED[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. ipaddr to_i
  5. _builtin i

検索結果

<< 1 2 3 ... > >>

irb (26096.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...irb は Interactive Ruby の略です。
i
rb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

=== irb の使い方

Ruby さえ知っていれば irb を使うのは簡単です。
i
rb コマンドを実行すると、以下のようなプロン...
...

$ irb
i
rb(main):001:0>

あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。

i
rb(main):001:0> 1+2
3
i
rb(main):002:0> class Foo
i
rb(main):003:1> def foo
i
rb(main):004:2> print 1
i
rb(main):005:2> end
i
rb(main):006:1>...
...い。

i
rb(main):004:0> x = "OK" # ローカル変数 x を定義
=> "OK"
i
rb(main):005:0> x # x を表示
=> "OK"
i
rb(main):006:0> irb # サブ irb を起動
i
rb#1(main):001:0> x # x を表示
NameError: undefined local variable or...

REXML::Element::UNDEFINED -> String (24317.0)

"UNDEFINED" という文字列。

..."UNDEFINED" という文字列。...

Encoding::UndefinedConversionError#destination_encoding -> Encoding (21300.0)

エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。

...エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。

@see Encoding::UndefinedConversionError#source_encoding...

Encoding::UndefinedConversionError#destination_encoding_name -> String (21300.0)

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#destination_encoding...

BasicObject#singleton_method_undefined(name) -> object (15337.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

...るフックには
Module#method_undefined を使います。

@param name 未定義にされたメソッド名が Symbol で渡されます。

//emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end

obj = Foo.new
def ob...
...foo
end
def obj.bar
end

class << obj
undef_method :foo
end
obj.instance_eval {undef bar}

#=> singleton method "foo" was undefined
# singleton method "bar" was undefined
//}

@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...

絞り込み条件を変える

Encoding::UndefinedConversionError#source_encoding -> Encoding (15200.0)

エラーを発生させた変換の変換元のエンコーディングを Encoding オブジェクトで返します。

...ーディングを Encoding
オブジェクトで返します。

変換が多段階になされる場合は元の文字列のものではない
エンコーディングが返される場合があることに注意してください。

@see Encoding::UndefinedConversionError#destination_encoding...

Encoding::UndefinedConversionError#source_encoding_name -> Encoding (15200.0)

エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

...エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#source_encoding...

Encoding::UndefinedConversionError (15000.0)

エンコーディング変換後の文字が存在しない場合に発生する例外。

...

UTF-8 にしかない文字を EUC-JP に変換しようとした場合などに発生します。

//emlist[例][ruby]{
"\u2603".encode(Encoding::EUC_JP)
#=> Encoding::UndefinedConversionError: U+2603 from UTF-8 to EUC-JP
//}


変換が多段階でなされ、その途中で例外が生じた...
...//emlist[例][ruby]{
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
# ISO-8859-1 -> UTF-8 -> EUC-JP
begin
ec.convert("\xa0")
# NO-BREAK SPACE, which is available in UTF-8 but not in EUC-JP.
rescue Encoding::UndefinedConversionError
p $!.source_encoding #=> #<Encoding:UTF-8...
...>
p $!.destination_encoding #=> #<Encoding:EUC-JP>
p $!.source_encoding_name #=> "UTF-8"
p $!.destination_encoding_name #=> "EUC-JP"
puts $!.error_char.dump #=> "\u{a0}"
p $!.error_char.encoding #=> #<Encoding:UTF-8>
end
//}...

Module#method_undefined(name) -> () (12231.0)

このモジュールのインスタンスメソッド name が Module#undef_method によって削除されるか、 undef 文により未定義にされると、インタプリタがこのメソッドを呼び出します。

...フックするには
BasicObject#singleton_method_undefined
を使います。

@param name 削除/未定義にされたメソッド名が Symbol で渡されます。

//emlist[例][ruby]{
class C
def C.method_undefined(name)
puts "method C\##{name} was undefined"
end

def foo
end
de...
...f bar
end

undef_method :foo
undef bar
end
//}

実行結果:

method C#foo was undefined
method C#bar was undefined...

static VALUE rb_undefined(VALUE obj, ID id, int argc, VALUE *argv, int call_status) (12200.0)

絞り込み条件を変える

<< 1 2 3 ... > >>