Class: HTTPLogAnalyzer::Element::Request
- Inherits:
-
HTTPLogAnalyzer::Element
- Object
- HTTPLogAnalyzer::Element
- HTTPLogAnalyzer::Element::Request
- Defined in:
- lib/http-log-analyzer/element/request.rb
Instance Attribute Summary collapse
-
#mime_types ⇒ Object
Returns the value of attribute mime_types.
-
#uri ⇒ Object
Returns the value of attribute uri.
Instance Method Summary collapse
Methods inherited from HTTPLogAnalyzer::Element
Instance Attribute Details
#mime_types ⇒ Object
Returns the value of attribute mime_types.
8 9 10 |
# File 'lib/http-log-analyzer/element/request.rb', line 8 def mime_types @mime_types end |
#uri ⇒ Object
Returns the value of attribute uri.
7 8 9 |
# File 'lib/http-log-analyzer/element/request.rb', line 7 def uri @uri end |
Instance Method Details
#parse(string) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/http-log-analyzer/element/request.rb', line 10 def parse(string) @method, uri_string, @version = string.split(/\s+/) @uri = Addressable::URI.parse(uri_string) or raise ParseError, "Can't parse URI: #{uri_string}" normalize_uri!(@uri) @mime_types = MIME::Types.type_for(@uri.path) end |