Class: IEHandler

Inherits:
Object
  • Object
show all
Defined in:
sample/ienavi2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeIEHandler

Returns a new instance of IEHandler.



6
7
8
9
# File 'sample/ienavi2.rb', line 6

def initialize
  @urls = []
  @loop = true
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(event, *args) ⇒ Object



10
11
12
13
14
15
# File 'sample/ienavi2.rb', line 10

def method_missing(event, *args)
  case event
  when "BeforeNavigate2"
    puts "Now Navigate #{args[1]}..."
  end
end

Instance Attribute Details

#loopObject (readonly)

Returns the value of attribute loop



5
6
7
# File 'sample/ienavi2.rb', line 5

def loop
  @loop
end

Instance Method Details

#onNavigateComplete2(pdisp, url) ⇒ Object



16
17
18
# File 'sample/ienavi2.rb', line 16

def onNavigateComplete2(pdisp, url)
  @urls << url
end

#onOnQuitObject



19
20
21
22
# File 'sample/ienavi2.rb', line 19

def onOnQuit
  puts "Now Stop IE..."
  @loop = false
end

#put_urlsObject



23
24
25
26
27
28
# File 'sample/ienavi2.rb', line 23

def put_urls
  puts "You Navigated the URLs ..."
  @urls.each_with_index do |url, i|
    puts "(#{i+1}) #{url}"
  end
end