Class: Horseman::Browser::Window
- Inherits:
-
Object
- Object
- Horseman::Browser::Window
- Defined in:
- lib/horseman/browser/window.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #alert(message) ⇒ Object
-
#initialize(browser, output = nil) ⇒ Window
constructor
A new instance of Window.
- #method_missing(method, *arguments, &block) ⇒ Object
- #respond_to?(method_sym, include_private = false) ⇒ Boolean
- #top ⇒ Object
- #window ⇒ Object
Constructor Details
#initialize(browser, output = nil) ⇒ Window
Returns a new instance of Window.
10 11 12 13 14 15 16 17 18 |
# File 'lib/horseman/browser/window.rb', line 10 def initialize(browser, output=nil) output ||= Output.new @browser = browser @output = output @document = @browser.last_action.response.document @location = Location.new(self) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *arguments, &block) ⇒ Object
35 36 37 |
# File 'lib/horseman/browser/window.rb', line 35 def method_missing(method, *arguments, &block) puts "Not implemented in Window: #{method} #{arguments.join(',')}" end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
7 8 9 |
# File 'lib/horseman/browser/window.rb', line 7 def browser @browser end |
#document ⇒ Object (readonly)
Returns the value of attribute document.
8 9 10 |
# File 'lib/horseman/browser/window.rb', line 8 def document @document end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
8 9 10 |
# File 'lib/horseman/browser/window.rb', line 8 def location @location end |
#output ⇒ Object (readonly)
Returns the value of attribute output.
7 8 9 |
# File 'lib/horseman/browser/window.rb', line 7 def output @output end |
Instance Method Details
#alert(message) ⇒ Object
20 21 22 |
# File 'lib/horseman/browser/window.rb', line 20 def alert() output.display end |
#respond_to?(method_sym, include_private = false) ⇒ Boolean
31 32 33 |
# File 'lib/horseman/browser/window.rb', line 31 def respond_to?(method_sym, include_private = false) true end |
#top ⇒ Object
24 25 26 |
# File 'lib/horseman/browser/window.rb', line 24 def top self end |
#window ⇒ Object
27 28 29 |
# File 'lib/horseman/browser/window.rb', line 27 def window self end |