33件ヒット
[1-33件を表示]
(0.071秒)
クラス
- Object (11)
-
Thread
:: Backtrace :: Location (11) -
WIN32OLE
_ EVENT (11)
キーワード
- handler= (11)
-
initialize
_ copy (11)
検索結果
先頭3件
-
Thread
:: Backtrace :: Location # inspect -> String (21113.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...:Location#to_s の結果を人間が読みやすいような文
字列に変換したオブジェクトを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call......|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "path/to/foo.rb:9:in `<main>'"
//}... -
WIN32OLE
_ EVENT # handler=(obj) -> () (9112.0) -
イベント処理を実行するオブジェクトを登録します。
...るにはnilを指定します。
class IeHandler
def initialize
@completed = false
end
attr_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@completed = tru......#{args.inspect}"
end
end
ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
loop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop......end
ie.Quit
WIN32OLE_EVENT#on_eventなどの呼び出しでブロックが登録されている場
合、そちらが優先されます。... -
Object
# initialize _ copy(obj) -> object (6112.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
...期化メソッド。
このメソッドは self を obj の内容で置き換えます。ただ
し、self のインスタンス変数や特異メソッドは変化しません。
Object#clone, Object#dupの内部で使われています。
initialize_copy は、Ruby インタプリタが知り......alize_copy(obj)
//}
obj2 に対してさらに obj の汚染状態、インスタンス変数、ファイナライザを
コピーすることで複製を作ります。 obj.clone は、さらに
特異メソッドのコピーも行います。
//emlist[][ruby]{
obj = Object.new
class <<obj
attr......riables: #{obj.inspect}"
puts "tainted?: #{obj.tainted?}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end
obj.foo = 1
obj.taint
check Object.new.send(:initialize_copy, obj)
#=> instance variables: #<Object:0x4019c9d4>
# tainted?: false......2.initialize_copy(obj)
//}
obj2 に対してさらに obj のインスタンス変数、ファイナライザを
コピーすることで複製を作ります。 obj.clone は、さらに
特異メソッドのコピーも行います。
//emlist[][ruby]{
obj = Object.new
class <<obj
attr_accesso......k(obj)
puts "instance variables: #{obj.inspect}"
print "singleton methods: "
begin
p obj.bar
rescue NameError
p $!
end
end
obj.foo = 1
check Object.new.send(:initialize_copy, obj)
#=> instance variables: #<Object:0x4019c9d4>
# singleton methods: #<NoMethodError:...