Class: StashCoreAPI::Request
- Inherits:
-
Object
- Object
- StashCoreAPI::Request
- Defined in:
- lib/stash_core_api/request.rb
Overview
Wrapper around HTTP, does basic auth on every request
Constant Summary collapse
- BASE_API_PATH =
'/rest/api/1.0'
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(client, endpoint) ⇒ Request
constructor
A new instance of Request.
Constructor Details
#initialize(client, endpoint) ⇒ Request
Returns a new instance of Request.
12 13 14 15 |
# File 'lib/stash_core_api/request.rb', line 12 def initialize(client, endpoint) @client = client @endpoint = endpoint end |
Instance Method Details
#get ⇒ Object
17 18 19 20 21 22 |
# File 'lib/stash_core_api/request.rb', line 17 def get response = HTTP .basic_auth(user: @client.user, pass: @client.pass) .get(req_url(@endpoint)) process(response) end |