Class: Steam::Browser::HtmlUnit::Page
- Inherits:
-
Object
- Object
- Steam::Browser::HtmlUnit::Page
show all
- Defined in:
- lib/steam/browser/html_unit/page.rb
Instance Method Summary
collapse
Constructor Details
#initialize(page) ⇒ Page
Returns a new instance of Page.
10
11
12
|
# File 'lib/steam/browser/html_unit/page.rb', line 10
def initialize(page)
@page = page
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
45
46
47
|
# File 'lib/steam/browser/html_unit/page.rb', line 45
def method_missing(method, *args)
return @page.send(method, *args)
end
|
Instance Method Details
#body ⇒ Object
29
30
31
|
# File 'lib/steam/browser/html_unit/page.rb', line 29
def body
@page.asXml
end
|
#execute(javascript) ⇒ Object
33
34
35
|
# File 'lib/steam/browser/html_unit/page.rb', line 33
def execute(javascript)
@page.executeJavaScript(javascript)
end
|
22
23
24
25
26
27
|
# File 'lib/steam/browser/html_unit/page.rb', line 22
def
@page.getWebResponse..toArray.inject({}) do |, pair|
[pair.name] = pair.value
end
end
|
#sourceCode ⇒ Object
37
38
39
|
# File 'lib/steam/browser/html_unit/page.rb', line 37
def sourceCode
@page.asXml
end
|
#status ⇒ Object
18
19
20
|
# File 'lib/steam/browser/html_unit/page.rb', line 18
def status
@page.getWebResponse.getStatusCode
end
|
#to_a ⇒ Object
41
42
43
|
# File 'lib/steam/browser/html_unit/page.rb', line 41
def to_a
[body, status, ]
end
|
#url ⇒ Object
14
15
16
|
# File 'lib/steam/browser/html_unit/page.rb', line 14
def url
@page.getWebResponse.getRequestSettings.getUrl.toString
end
|