Module: Cronofy

Defined in:
lib/cronofy.rb,
lib/cronofy/auth.rb,
lib/cronofy/types.rb,
lib/cronofy/client.rb,
lib/cronofy/errors.rb,
lib/cronofy/api_key.rb,
lib/cronofy/version.rb,
lib/cronofy/time_encoding.rb,
lib/cronofy/response_parser.rb

Defined Under Namespace

Modules: Events, FreeBusyEnumerable, ISO8601Time, ParticipantEnumerable, SequenceItemEnumerable, SmartInviteReplyEnumerable, TimeEncoding Classes: APIError, Account, AccountLockedError, AddToCalendarResponse, ApiKey, Auth, AuthenticationFailureError, AuthorizationFailureError, AvailablePeriod, BadRequestError, BatchEntry, BatchEntryRequest, BatchEntryResponse, BatchResponse, Calendar, Channel, Client, Credentials, CredentialsMissingError, Cronofy, CronofyError, CronofyMash, DateOrTime, Errors, Event, EventTime, FreeBusy, InvalidRequestError, NotFoundError, PagedEventsResult, PagedFreeBusyResult, Participant, PaymentRequiredError, PermissionsResponse, Profile, Proposal, Resource, ResponseParser, Sequence, SequenceItem, ServerError, SmartInviteReply, SmartInviteResponse, TooManyRequestsError, UnknownError, UserInfo

Constant Summary collapse

VERSION =
"0.30.0".freeze

Class Method Summary collapse

Class Method Details

.api_url(data_centre_override) ⇒ Object


23
24
25
26
27
28
29
# File 'lib/cronofy.rb', line 23

def self.api_url(data_centre_override)
  if data_centre_override
    api_url_for_data_centre(data_centre_override)
  else
    ENV['CRONOFY_API_URL'] || api_url_for_data_centre(default_data_centre)
  end
end

.api_url=(value) ⇒ Object


31
32
33
# File 'lib/cronofy.rb', line 31

def self.api_url=(value)
  @api_url = value
end

.api_url_for_data_centre(dc) ⇒ Object


35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cronofy.rb', line 35

def self.api_url_for_data_centre(dc)
  @api_urls ||= Hash.new do |hash, key|
    if key.nil? || key.to_sym == :us
      url = "https://api.cronofy.com"
    else
      url = "https://api-#{key}.cronofy.com"
    end

    hash[key] = url.freeze
  end

  @api_urls[dc]
end

.app_url(data_centre_override) ⇒ Object


49
50
51
52
53
54
55
# File 'lib/cronofy.rb', line 49

def self.app_url(data_centre_override)
  if data_centre_override
    app_url_for_data_centre(data_centre_override)
  else
    ENV['CRONOFY_APP_URL'] || app_url_for_data_centre(default_data_centre)
  end
end

.app_url=(value) ⇒ Object


57
58
59
# File 'lib/cronofy.rb', line 57

def self.app_url=(value)
  @app_url = value
end

.app_url_for_data_centre(dc) ⇒ Object


61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/cronofy.rb', line 61

def self.app_url_for_data_centre(dc)
  @app_urls ||= Hash.new do |hash, key|
    if key.nil? || key.to_sym == :us
      url = "https://app.cronofy.com"
    else
      url = "https://app-#{key}.cronofy.com"
    end

    hash[key] = url.freeze
  end

  @app_urls[dc]
end

.default_data_centreObject


15
16
17
# File 'lib/cronofy.rb', line 15

def self.default_data_centre
  @default_data_centre || ENV['CRONOFY_DATA_CENTRE']
end

.default_data_centre=(value) ⇒ Object


19
20
21
# File 'lib/cronofy.rb', line 19

def self.default_data_centre=(value)
  @default_data_centre = value
end