Class: Arachni::Parser::Page
Overview
@version: 0.2
Instance Attribute Summary collapse
-
#code ⇒ Fixnum
The HTTP response code.
-
#cookiejar ⇒ Hash
Cookies extracted from the supplied cookiejar.
- #cookies ⇒ Array<Arachni::Parser::Element::Cookie>
- #forms ⇒ Array<Arachni::Parser::Element::Form>
-
#headers ⇒ Array<Arachni::Parser::Element::Header>
Request headers.
-
#html ⇒ String
The HTML response.
- #links ⇒ Array<Arachni::Parser::Element::Link>
-
#method ⇒ String
The request method that returned the page.
-
#query_vars ⇒ Hash
Url variables.
- #response_headers ⇒ Hash
-
#url ⇒ String
Url of the page.
Instance Method Summary collapse
- #body ⇒ Object
-
#cookies_simple ⇒ Hash
Returns cookies from #cookies as a name=>value hash.
-
#forms_simple ⇒ Array
Returns an array of forms from #forms with its attributes and<br/> its auditable inputs as a name=>value hash.
-
#initialize(opts = {}) ⇒ Page
constructor
A new instance of Page.
-
#links_simple ⇒ Hash
Returns links from #links as a name=>value hash with href as key.
Constructor Details
#initialize(opts = {}) ⇒ Page
Returns a new instance of Page.
91 92 93 94 95 96 97 |
# File 'lib/parser/page.rb', line 91 def initialize( opts = {} ) opts.each { |k, v| send( "#{k}=", v ) } end |
Instance Attribute Details
#code ⇒ Fixnum
Returns the HTTP response code.
34 35 36 |
# File 'lib/parser/page.rb', line 34 def code @code end |
#cookiejar ⇒ Hash
Cookies extracted from the supplied cookiejar
89 90 91 |
# File 'lib/parser/page.rb', line 89 def end |
#cookies ⇒ Array<Arachni::Parser::Element::Cookie>
82 83 84 |
# File 'lib/parser/page.rb', line 82 def end |
#forms ⇒ Array<Arachni::Parser::Element::Form>
75 76 77 |
# File 'lib/parser/page.rb', line 75 def forms @forms end |
#headers ⇒ Array<Arachni::Parser::Element::Header>
Request headers
56 57 58 |
# File 'lib/parser/page.rb', line 56 def headers @headers end |
#html ⇒ String
Returns the HTML response.
49 50 51 |
# File 'lib/parser/page.rb', line 49 def html @html end |
#links ⇒ Array<Arachni::Parser::Element::Link>
68 69 70 |
# File 'lib/parser/page.rb', line 68 def links @links end |
#method ⇒ String
Returns the request method that returned the page.
39 40 41 |
# File 'lib/parser/page.rb', line 39 def method @method end |
#query_vars ⇒ Hash
Returns url variables.
44 45 46 |
# File 'lib/parser/page.rb', line 44 def query_vars @query_vars end |
#response_headers ⇒ Hash
61 62 63 |
# File 'lib/parser/page.rb', line 61 def response_headers @response_headers end |
#url ⇒ String
Returns url of the page.
29 30 31 |
# File 'lib/parser/page.rb', line 29 def url @url end |
Instance Method Details
#body ⇒ Object
99 100 101 |
# File 'lib/parser/page.rb', line 99 def body @html end |
#cookies_simple ⇒ Hash
Returns cookies from #cookies as a name=>value hash
137 138 139 140 141 142 143 144 145 |
# File 'lib/parser/page.rb', line 137 def = { } .each { || .merge!( .simple ) } return end |
#forms_simple ⇒ Array
Returns an array of forms from #forms with its attributes and<br/> its auditable inputs as a name=>value hash
109 110 111 112 113 114 115 116 |
# File 'lib/parser/page.rb', line 109 def forms_simple( ) forms = [] @forms.each { |form| forms << form.simple } return forms end |
#links_simple ⇒ Hash
Returns links from #links as a name=>value hash with href as key
123 124 125 126 127 128 129 130 |
# File 'lib/parser/page.rb', line 123 def links_simple links = [] @links.each { |link| links << link.simple } return links end |