Class: RIESS::ActiveConsole
- Inherits:
-
Object
- Object
- RIESS::ActiveConsole
- Defined in:
- lib/riess.rb
Defined Under Namespace
Classes: IEWindow
Instance Attribute Summary collapse
-
#all_windows ⇒ Object
readonly
Returns the value of attribute all_windows.
-
#windows ⇒ Object
readonly
Returns the value of attribute windows.
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(window_title) ⇒ ActiveConsole
constructor
A new instance of ActiveConsole.
- #list_all_windows ⇒ Object
- #list_windows ⇒ Object
Constructor Details
#initialize(window_title) ⇒ ActiveConsole
Returns a new instance of ActiveConsole.
80 81 82 83 84 85 |
# File 'lib/riess.rb', line 80 def initialize(window_title) @window_title = window_title @windows = [] @all_windows = [] connect end |
Instance Attribute Details
#all_windows ⇒ Object (readonly)
Returns the value of attribute all_windows.
77 78 79 |
# File 'lib/riess.rb', line 77 def all_windows @all_windows end |
#windows ⇒ Object (readonly)
Returns the value of attribute windows.
77 78 79 |
# File 'lib/riess.rb', line 77 def windows @windows end |
Instance Method Details
#connect ⇒ Object
87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/riess.rb', line 87 def connect WIN32OLE.new('Shell.Application').Windows.each{|w| begin if w.document.title.match(/#{@window_title}/) @windows << IEWindow.new(w.Document.Title,w) elsif w.document.title != "" @all_windows << IEWindow.new(w.document.title,w) end rescue end } end |
#list_all_windows ⇒ Object
105 106 107 |
# File 'lib/riess.rb', line 105 def list_all_windows @all_windows.each_with_index{|w,i| puts "#{i} : #{w.title}"} end |
#list_windows ⇒ Object
101 102 103 |
# File 'lib/riess.rb', line 101 def list_windows @windows.each_with_index{|w,i| puts "#{i} : #{w.title}"} end |