るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.065秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

Thread::Backtrace::Location#inspect -> String (18226.0)

Thread::Backtrace::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/f...

Object#initialize_copy(obj) -> object (149.0)

(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。

...の内部で Object#initialize_clone から、
また Object#dup の内部で Object#initialize_dup から呼ばれます。

initialize_copy は、Ruby インタプリタが知り得ない情報をコピーするた
めに使用(定義)されます。例えば C 言語でクラスを実装する場...
...に利用しているかを示します。

obj.dup は、新たに生成したオブジェクトに対して
initialize_copy を呼び

//emlist[][ruby]{
obj2 = obj.class.allocate
obj2.initialize_copy(obj)
//}

obj2 に対してさらに obj の汚染状態、インスタンス変数、ファイナ...
...e は、さらに
特異メソッドのコピーも行います。

//emlist[][ruby]{
obj = Object.new
class <<obj
attr
_accessor :foo
def bar
:bar
end
end

def check(obj)
puts "instance variables: #{obj.inspect}"
puts "tainted?: #{obj.tainted?}"
print "singleton methods: "
begin...
...st[][ruby]{
obj2 = obj.class.allocate
obj2.initialize_copy(obj)
//}

obj2 に対してさらに obj のインスタンス変数、ファイナライザを
コピーすることで複製を作ります。 obj.clone は、さらに
特異メソッドのコピーも行います。

//emlist[][ruby]{
ob...
...j = Object.new
class <<obj
attr
_accessor :foo
def bar
:bar
end
end

def check(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)
#=> in...

WIN32OLE_EVENT#handler=(obj) -> () (131.0)

イベント処理を実行するオブジェクトを登録します。

...end
attr
_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@completed = true
end
def method_missing(id, *args)
puts "event=#{id.to_s}, args=#{args.inspect}"...
...'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などの呼...