Class: Gobuster::Response
- Inherits:
-
Object
- Object
- Gobuster::Response
- Defined in:
- lib/gobuster/response.rb
Overview
Represents a HTTP resposne found by gobuster dir
or gobuster fuzz
.
Instance Attribute Summary collapse
-
#path ⇒ String?
readonly
The path of the response.
-
#size ⇒ Integer
readonly
The size of the response.
-
#status ⇒ Integer
readonly
The HTTP status code.
-
#url ⇒ String?
readonly
The URL of the response.
Instance Method Summary collapse
-
#initialize(path: nil, url: nil, status:, size:) ⇒ Response
constructor
Initializes the HTTP response.
-
#to_s ⇒ String
(also: #to_str)
Converts the response to a String.
Constructor Details
#initialize(path: nil, url: nil, status:, size:) ⇒ Response
Initializes the HTTP response.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/gobuster/response.rb', line 41 def initialize(path: nil, url: nil, status: , size: ) if url @url = url @path = nil elsif path @url = nil @path = path else raise(ArgumentError,"path: or url: keyword argument must be given") end @status = status @size = size end |
Instance Attribute Details
#path ⇒ String? (readonly)
The path of the response.
10 11 12 |
# File 'lib/gobuster/response.rb', line 10 def path @path end |
#size ⇒ Integer (readonly)
The size of the response.
25 26 27 |
# File 'lib/gobuster/response.rb', line 25 def size @size end |
#status ⇒ Integer (readonly)
The HTTP status code.
20 21 22 |
# File 'lib/gobuster/response.rb', line 20 def status @status end |
#url ⇒ String? (readonly)
The URL of the response.
15 16 17 |
# File 'lib/gobuster/response.rb', line 15 def url @url end |
Instance Method Details
#to_s ⇒ String Also known as: to_str
Converts the response to a String.
61 62 63 |
# File 'lib/gobuster/response.rb', line 61 def to_s @path || @url end |