Class: Arachni::Parser::Page
Overview
@version: 0.2.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.
-
#paths ⇒ Object
Returns the value of attribute paths.
-
#query_vars ⇒ Hash
Url variables.
- #response_headers ⇒ Hash
-
#url ⇒ String
Url of the page.
Class Method Summary collapse
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.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/arachni/parser/page.rb', line 99 def initialize( opts = {} ) @forms = [] @links = [] @cookies = [] @headers = [] @cookiejar = {} @paths = [] @response_headers = {} @query_vars = {} opts.each { |k, v| send( "#{k}=", v ) } end |
Instance Attribute Details
#code ⇒ Fixnum
Returns the HTTP response code.
34 35 36 |
# File 'lib/arachni/parser/page.rb', line 34 def code @code end |
#cookiejar ⇒ Hash
Cookies extracted from the supplied cookiejar
91 92 93 |
# File 'lib/arachni/parser/page.rb', line 91 def @cookiejar end |
#cookies ⇒ Array<Arachni::Parser::Element::Cookie>
84 85 86 |
# File 'lib/arachni/parser/page.rb', line 84 def @cookies end |
#forms ⇒ Array<Arachni::Parser::Element::Form>
77 78 79 |
# File 'lib/arachni/parser/page.rb', line 77 def forms @forms end |
#headers ⇒ Array<Arachni::Parser::Element::Header>
Request headers
56 57 58 |
# File 'lib/arachni/parser/page.rb', line 56 def headers @headers end |
#html ⇒ String
Returns the HTML response.
49 50 51 |
# File 'lib/arachni/parser/page.rb', line 49 def html @html end |
#links ⇒ Array<Arachni::Parser::Element::Link>
70 71 72 |
# File 'lib/arachni/parser/page.rb', line 70 def links @links end |
#method ⇒ String
Returns the request method that returned the page.
39 40 41 |
# File 'lib/arachni/parser/page.rb', line 39 def method @method end |
#paths ⇒ Object
Returns the value of attribute paths.
63 64 65 |
# File 'lib/arachni/parser/page.rb', line 63 def paths @paths end |
#query_vars ⇒ Hash
Returns url variables.
44 45 46 |
# File 'lib/arachni/parser/page.rb', line 44 def query_vars @query_vars end |
#response_headers ⇒ Hash
61 62 63 |
# File 'lib/arachni/parser/page.rb', line 61 def response_headers @response_headers end |
#url ⇒ String
Returns url of the page.
29 30 31 |
# File 'lib/arachni/parser/page.rb', line 29 def url @url end |
Class Method Details
Instance Method Details
#body ⇒ Object
118 119 120 |
# File 'lib/arachni/parser/page.rb', line 118 def body @html end |
#cookies_simple ⇒ Hash
Returns cookies from #cookies as a name=>value hash
156 157 158 159 160 161 162 163 164 |
# File 'lib/arachni/parser/page.rb', line 156 def = { } @cookies.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
128 129 130 131 132 133 134 135 |
# File 'lib/arachni/parser/page.rb', line 128 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
142 143 144 145 146 147 148 149 |
# File 'lib/arachni/parser/page.rb', line 142 def links_simple links = [] @links.each { |link| links << link.simple } return links end |