種類
- 関数 (231)
- インスタンスメソッド (145)
- 文書 (53)
- クラス (22)
- 特異メソッド (2)
クラス
- BasicObject (11)
- Data (4)
-
Encoding
:: UndefinedConversionError (22) - Module (99)
-
WIN32OLE
_ TYPE (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 3 . 0 (9) - Ruby用語集 (11)
- UndefinedConversionError (11)
- UndefinedNamespaceException (11)
-
class
_ variable _ defined? (11) -
const
_ defined? (11) -
deconstruct
_ keys (2) -
default
_ event _ sources (11) -
define
_ method (22) -
destination
_ encoding _ name (11) -
method
_ defined? (11) -
method
_ undefined (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ method _ defined? (11) -
rb
_ define _ attr (11) -
rb
_ define _ class (11) -
rb
_ define _ class _ under (11) -
rb
_ define _ class _ variable (11) -
rb
_ define _ const (11) -
rb
_ define _ global _ const (11) -
rb
_ define _ global _ function (11) -
rb
_ define _ hooked _ variable (11) -
rb
_ define _ method (11) -
rb
_ define _ method _ id (11) -
rb
_ define _ module (11) -
rb
_ define _ module _ function (11) -
rb
_ define _ module _ under (11) -
rb
_ define _ private _ method (11) -
rb
_ define _ protected _ method (11) -
rb
_ define _ readonly _ variable (11) -
rb
_ define _ singleton _ method (11) -
rb
_ define _ variable (11) -
rb
_ define _ virtual _ variable (11) -
rb
_ ivar _ defined (11) -
rb
_ mod _ const _ defined (11) -
ruby 1
. 6 feature (11) -
singleton
_ method _ undefined (11) -
source
_ encoding _ name (11) - リテラル (11)
検索結果
先頭5件
-
Encoding
:: UndefinedConversionError # destination _ encoding _ name -> String (30401.0) -
エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換先のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#destination_encoding... -
Encoding
:: UndefinedConversionError # source _ encoding _ name -> Encoding (27401.0) -
エラーを発生させた変換の変換元のエンコーディングを文字列で返します。
...エラーを発生させた変換の変換元のエンコーディングを文字列で返します。
@see Encoding::UndefinedConversionError#source_encoding... -
Data
. define(*args) {|subclass| block } -> Class (24374.0) -
Data クラスに新しいサブクラスを作って、それを返します。
...が定義されています。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}
メンバの値を書き換えることはできません。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fr......//emlist[例][ruby]{
class HTTPFetcher
Response = Data.define(:body)
NotFound = Data.define
def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end
def fetch(url)
fetch......HTTPFetcher.new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end
p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}
@param args 値オブジェ... -
REXML
:: UndefinedNamespaceException (24000.0) -
XMLのパース中に、定義されていない名前空間が現れた場合に発生する 例外です。
XMLのパース中に、定義されていない名前空間が現れた場合に発生する
例外です。 -
BasicObject
# singleton _ method _ undefined(name) -> object (21519.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...特異メソッドが Module#undef_method または
undef により未定義にされた時にインタプリタから呼び出されます。
通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。
@param name 未定義にされたメソッド名....../emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end
obj = Foo.new
def obj.foo
end
def obj.bar
end
class << obj
undef_method :foo
end
obj.instance_eval {undef bar}
#=> singleton method "foo" was undefined
# single......ton method "bar" was undefined
//}
@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef... -
Encoding
:: UndefinedConversionError (21030.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
//}... -
VALUE rb
_ define _ class _ under(VALUE outer , const char *name , VALUE super) (18612.0) -
super のサブクラスとして新しい Ruby クラスを、outer の定数として定義し て返します。
...super のサブクラスとして新しい Ruby クラスを、outer の定数として定義し
て返します。
@param outer 定義するクラスが定数として所属するクラス
@param name クラス名
@param super 継承元のクラス。NULL を指定した場合は Object クラ......ス
@raise TypeError 引数 name と同じ名前の定数が既に存在し、それが
Class オブジェクトではない場合に発生します。......ス
@raise TypeError 引数 name と同じ名前の定数が既に存在し、それが
Class オブジェクトではない場合に発生します。
@raise TypeError 定義済みのクラスと継承元のクラスが一致しない場合に発生
します。... -
void rb
_ define _ global _ function(const char *name , VALUE (*func)() , int argc) (18538.0) -
関数 name を定義します。 func と argc は rb_define_method と同じです。
... name を定義します。
func と argc は rb_define_method と同じです。
例:
static VALUE
return_obj_dup(VALUE obj)
{
VALUE dup = rb_obj_dup(obj); // オブジェクトを複製
return dup;
}
void Init_func() {
rb_define_global_function("dup_ob......j", return_obj_dup, 1); // 関数 dup_objを定義しています。
}... -
void rb
_ define _ module _ function(VALUE module , const char *name , VALUE (*func)() , int argc) (18532.0) -
モジュール module にモジュール関数 name を定義します。 func と argc は rb_define_method と同じです。
...モジュール module にモジュール関数 name を定義します。
func と argc は rb_define_method と同じです。... -
void rb
_ define _ singleton _ method(VALUE obj , const char *name , VALUE (*func)() , int argc) (18532.0) -
obj に特異メソッド name を定義します。 メソッドの実体を func に関数ポインタで与え、その関数がとる 引数のタイプを argc に渡します。argc のフォーマットに ついては rb_define_method の記述を参照してください。
...obj に特異メソッド name を定義します。
メソッドの実体を func に関数ポインタで与え、その関数がとる
引数のタイプを argc に渡します。argc のフォーマットに
ついては rb_define_method の記述を参照してください。...