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.
10 11 12 13 |
# File 'lib/stash_core_api/request.rb', line 10 def initialize(client, endpoint) @client = client @endpoint = endpoint end |
Instance Method Details
#get ⇒ Object
15 16 17 18 19 20 |
# File 'lib/stash_core_api/request.rb', line 15 def get response = HTTP .basic_auth(user: @client.user, pass: @client.pass) .get(req_url(@endpoint)) process(response) end |