るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.107秒)
トップページ > バージョン:2.3.0[x] > クエリ:l[x] > クエリ:y[x] > クエリ:convert_type[x]

別のキーワード

  1. psych psych_y
  2. psych y
  3. kernel y
  4. kernel psych_y
  5. psych_y

キーワード

検索結果

static VALUE convert_type(VALUE val, const char *tname, const char *method, int raise) (133201.0)

VALUE rb_check_convert_type(VALUE val, int type, const char *tname, const char *method) (37501.0)

val.method を実行してクラス tname のインスタンスを返します。 val がメソッド method を持たなければ nil を返します。

val.method を実行してクラス tname のインスタンスを返します。
val がメソッド method を持たなければ nil を返します。

type は、T_ARRAY, T_STRING などの構造体を表す ID です。
method の結果の型が type でなければ例外 TypeError が発生します。

VALUE rb_convert_type(VALUE val, int type, const char *tname, const char *method) (37501.0)

オブジェクト val をクラス type のインスタンスに変換します。 変換には、val.method の戻り値が使われます。

オブジェクト val をクラス type のインスタンスに変換します。
変換には、val.method の戻り値が使われます。

val がもともと type クラスのインスタンスなら val を
そのまま返します。