class EcalClient::Api

Constants

API_VERSION
CALENDAR
EVENT
ORGANISATION
PUBLISHER
SUBSCRIBER
SUBSCRIPTION_WIDGET

Public Class Methods

new(options = {}) click to toggle source
# File lib/ecal_client/api.rb, line 12
def initialize(options = {})
  @key = options.delete(:key) || EcalClient.configuration.key
  @secret = options.delete(:secret) || EcalClient.configuration.secret
  EcalClient.configuration.options.merge!(options)
end

Public Instance Methods

calendar() click to toggle source
# File lib/ecal_client/api.rb, line 30
def calendar
  @calendar ||= Rest.new(endpoint_for(CALENDAR), [:get, :post, :put], credentials)
end
credentials() click to toggle source
# File lib/ecal_client/api.rb, line 18
def credentials
  { key: @key, secret: @secret }
end
event() click to toggle source
# File lib/ecal_client/api.rb, line 34
def event
  @event ||= Rest.new(endpoint_for(EVENT), [:get, :post, :put], credentials)
end
organisation() click to toggle source
# File lib/ecal_client/api.rb, line 22
def organisation
  @organisation ||= Rest.new(endpoint_for(ORGANISATION), [:get, :post, :put], credentials)
end
publisher() click to toggle source
# File lib/ecal_client/api.rb, line 26
def publisher
  @publisher ||= Rest.new(endpoint_for(PUBLISHER), [:get, :put], credentials)
end
subscriber() click to toggle source
# File lib/ecal_client/api.rb, line 42
def subscriber
  @subscriber ||= Rest.new(endpoint_for(SUBSCRIBER), [:get, :post, :put], credentials)
end
subscription_widget() click to toggle source
# File lib/ecal_client/api.rb, line 38
def subscription_widget
  @subscription_widget ||= Rest.new(endpoint_for(SUBSCRIPTION_WIDGET), [:get], credentials)
end

Private Instance Methods

endpoint_for(name) click to toggle source
# File lib/ecal_client/api.rb, line 48
def endpoint_for(name)
  API_VERSION + name
end