Class: Alman::DefaultClient

Inherits:
ApiClient show all
Defined in:
lib/alman/clients/default_client.rb

Instance Attribute Summary

Attributes inherited from ApiClient

#headers, #params

Instance Method Summary collapse

Methods inherited from ApiClient

#execute, #inspect

Constructor Details

#initialize(api_key) ⇒ DefaultClient

Returns a new instance of DefaultClient.



4
5
6
# File 'lib/alman/clients/default_client.rb', line 4

def initialize(api_key)
  self.refresh_from(api_key)
end

Instance Method Details

#bookingsObject



26
27
28
# File 'lib/alman/clients/default_client.rb', line 26

def bookings
  @bookings ||= BookingsEndpoint.new(self)
end

#calendarsObject



18
19
20
# File 'lib/alman/clients/default_client.rb', line 18

def calendars
  @calendars ||= CalendarsEndpoint.new(self)
end

#refresh_from(api_key) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/alman/clients/default_client.rb', line 8

def refresh_from(api_key)
  headers = {
    :Accept => "application/json",
    :"Content-Type" => "application/json",
    :Authorization => api_key,
  }
  params = {}
  super(headers, params)
end

#vacanciesObject



22
23
24
# File 'lib/alman/clients/default_client.rb', line 22

def vacancies
  @vacancies ||= VacanciesEndpoint.new(self)
end