Class: Arachni::HTTP::Message
- Defined in:
- lib/arachni/http/message.rb,
lib/arachni/http/message/scope.rb
Overview
Defined Under Namespace
Classes: Scope
Instance Attribute Summary collapse
- #body ⇒ String
-
#headers ⇒ Headers<String, String>
HTTP headers as a Hash-like object.
-
#url ⇒ String
Resource location.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Message
constructor
A new instance of Message.
- #parsed_url ⇒ Object
- #scope ⇒ Scope
Constructor Details
#initialize(options = {}) ⇒ Message
Note:
All options will be sent through the class setters whenever possible to allow for normalization.
Returns a new instance of Message.
39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/arachni/http/message.rb', line 39 def initialize( = {} ) .each do |k, v| begin send( "#{k}=", v ) rescue NoMethodError instance_variable_set( "@#{k}".to_sym, v ) end end fail ArgumentError, 'Missing :url.' if url.to_s.empty? @headers = Headers.new( @headers ) end |
Instance Attribute Details
#body ⇒ String
26 27 28 |
# File 'lib/arachni/http/message.rb', line 26 def body @body end |
#headers ⇒ Headers<String, String>
Returns HTTP headers as a Hash-like object.
22 23 24 |
# File 'lib/arachni/http/message.rb', line 22 def headers @headers end |
#url ⇒ String
Returns Resource location.
18 19 20 |
# File 'lib/arachni/http/message.rb', line 18 def url @url end |
Instance Method Details
#parsed_url ⇒ Object
58 59 60 61 |
# File 'lib/arachni/http/message.rb', line 58 def parsed_url # Don't cache this, that's already handled by the URI parser's own cache. Arachni::URI( url ) end |
#scope ⇒ Scope
54 55 56 |
# File 'lib/arachni/http/message.rb', line 54 def scope @scope ||= self.class::Scope.new( self ) end |