Class: EcalClient::Api

Inherits:
Object
  • Object
show all
Defined in:
lib/ecal_client/api.rb

Defined Under Namespace

Classes: Base, Rest

Constant Summary collapse

API_VERSION =
"/apiv2".freeze
ORGANISATION =
"/organisation/".freeze
PUBLISHER =
"/publisher/".freeze
CALENDAR =
"/calendar/".freeze
EVENT =
"/event/".freeze
SUBSCRIPTION_WIDGET =
"/subscription-widget/".freeze
SUBSCRIBER =
"/subscriber/".freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Api

Returns a new instance of Api.



12
13
14
# File 'lib/ecal_client/api.rb', line 12

def initialize(options = {})
  @options = options
end

Instance Method Details

#calendarObject



24
25
26
# File 'lib/ecal_client/api.rb', line 24

def calendar
  @calendar ||= Rest.new(endpoint_for(CALENDAR), [:get, :post, :put], @options)
end

#eventObject



28
29
30
# File 'lib/ecal_client/api.rb', line 28

def event
  @event ||= Rest.new(endpoint_for(EVENT), [:get, :post, :put], @options)
end

#organisationObject



16
17
18
# File 'lib/ecal_client/api.rb', line 16

def organisation
  @organisation ||= Rest.new(endpoint_for(ORGANISATION), [:get, :post, :put], @options)
end

#publisherObject



20
21
22
# File 'lib/ecal_client/api.rb', line 20

def publisher
  @publisher ||= Rest.new(endpoint_for(PUBLISHER), [:get, :put], @options)
end

#subscriberObject



36
37
38
# File 'lib/ecal_client/api.rb', line 36

def subscriber
  @subscriber ||= Rest.new(endpoint_for(SUBSCRIBER), [:get, :post, :put], @options)
end

#subscription_widgetObject



32
33
34
# File 'lib/ecal_client/api.rb', line 32

def subscription_widget
  @subscription_widget ||= Rest.new(endpoint_for(SUBSCRIPTION_WIDGET), [:get], @options)
end