Class: BookingSync::API::Client
- Inherits:
-
Object
- Object
- BookingSync::API::Client
- Defined in:
- lib/bookingsync/api/client.rb,
lib/bookingsync/api/client/rentals.rb,
lib/bookingsync/api/client/bookings.rb
Defined Under Namespace
Constant Summary collapse
- MEDIA_TYPE =
"application/vnd.api+json"
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#api_endpoint ⇒ String
Return API endpoint.
-
#get(path, options = {}) ⇒ Array<Sawyer::Resource>
Make a HTTP GET request.
-
#initialize(token) ⇒ BookingSync::API::Client
constructor
Initialize new Client.
Methods included from Rentals
Methods included from Bookings
Constructor Details
#initialize(token) ⇒ BookingSync::API::Client
Initialize new Client
19 20 21 |
# File 'lib/bookingsync/api/client.rb', line 19 def initialize(token) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
13 14 15 |
# File 'lib/bookingsync/api/client.rb', line 13 def token @token end |
Instance Method Details
#api_endpoint ⇒ String
Return API endpoint
34 35 36 |
# File 'lib/bookingsync/api/client.rb', line 34 def api_endpoint "#{base_url}/api/v3" end |
#get(path, options = {}) ⇒ Array<Sawyer::Resource>
Make a HTTP GET request
27 28 29 |
# File 'lib/bookingsync/api/client.rb', line 27 def get(path, = {}) request :get, path, end |