Class: Gitlab::QA::Support::GetRequest
- Inherits:
-
Object
- Object
- Gitlab::QA::Support::GetRequest
- Defined in:
- lib/gitlab/qa/support/get_request.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(uri, token) ⇒ GetRequest
constructor
A new instance of GetRequest.
Constructor Details
#initialize(uri, token) ⇒ GetRequest
Returns a new instance of GetRequest.
10 11 12 13 |
# File 'lib/gitlab/qa/support/get_request.rb', line 10 def initialize(uri, token) @uri = uri @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
8 9 10 |
# File 'lib/gitlab/qa/support/get_request.rb', line 8 def token @token end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
8 9 10 |
# File 'lib/gitlab/qa/support/get_request.rb', line 8 def uri @uri end |
Instance Method Details
#execute! ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/gitlab/qa/support/get_request.rb', line 15 def execute! response = Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http| http.request(build_request) end case response when Net::HTTPSuccess response else raise Support::InvalidResponseError.new(uri.to_s, response) end end |