60件ヒット
[1-60件を表示]
(0.079秒)
別のキーワード
ライブラリ
- ビルトイン (24)
-
irb
/ cmd / subirb (12) -
irb
/ context (12) -
json
/ add / exception (12)
クラス
- Exception (12)
-
IRB
:: Context (12) -
IRB
:: ExtendCommand :: IrbCommand (12) - NoMethodError (12)
- Object (12)
キーワード
- args (12)
- execute (12)
-
respond
_ to? (12) -
to
_ json (12)
検索結果
先頭5件
-
IRB
:: Context # main -> object (18202.0) -
self に設定されたオブジェクトを返します。
self に設定されたオブジェクトを返します。
@see cwws コマンド -
Exception
# to _ json(*args) -> String (6107.0) -
自身を JSON 形式の文字列に変換して返します。
...自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡......れます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
Object
# respond _ to?(name , include _ all = false) -> bool (3007.0) -
オブジェクトがメソッド name を持つとき真を返します。
...されたメソッドで NotImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。......onjour"
end
end
class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour
list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello, true)")}
#=> Bonjour
# Guten Tag
module Template
def main... -
IRB
:: ExtendCommand :: IrbCommand # execute(*obj) -> IRB :: Irb (107.0) -
新しいサブ irb インタプリタを起動します。
...新しいサブ irb インタプリタを起動します。
@param obj 新しいサブ irb インタプリタで self にするオブジェクトを指定
します。省略した場合は irb を起動したときの main オブジェク
トを self にします。... -
NoMethodError
# args -> [object] (107.0) -
メソッド呼び出しに使われた引数を配列で返します。
...メソッド呼び出しに使われた引数を配列で返します。
例:
begin
foobar(1,2,3)
rescue NoMethodError
p $!
p $!.name
p $!.args
end
# => #<NoMethodError: undefined method `foobar' for main:Object>
:foobar
[1, 2, 3]...