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, WeeklyPeriodEnumerable
Classes: APIError, Account, AccountLockedError, AddToCalendarResponse, ApiKey, Auth, AuthenticationFailureError, AuthorizationFailureError, AvailabilityRule, AvailablePeriod, AvailableSlot, BadGatewayError, BadRequestError, BatchEntry, BatchEntryRequest, BatchEntryResponse, BatchResponse, Calendar, Channel, Client, ConferencingServiceAuthorizationResponse, Credentials, CredentialsMissingError, Cronofy, CronofyError, CronofyMash, DateOrTime, ElementToken, Errors, Event, EventTime, FreeBusy, GatewayTimeoutError, InvalidRequestError, NotFoundError, PagedEventsResult, PagedFreeBusyResult, Participant, PaymentRequiredError, PermissionsResponse, Profile, Proposal, RealTimeSchedulingStatus, Resource, ResponseParser, SchedulingConversation, SchedulingConversationResponse, SchedulingConversationSlot, Sequence, SequenceItem, ServerError, ServiceUnavailableError, ServiceUnreachableError, SmartInviteReply, SmartInviteResponse, TooManyRequestsError, UnknownError, UserInfo, WeeklyPeriod
Constant Summary
collapse
- VERSION =
"0.41.2".freeze
Class Method Summary
collapse
Class Method Details
.api_url(data_center_override) ⇒ Object
31
32
33
34
35
36
37
|
# File 'lib/cronofy.rb', line 31
def self.api_url(data_center_override)
if data_center_override
api_url_for_data_center(data_center_override)
else
ENV['CRONOFY_API_URL'] || api_url_for_data_center(default_data_center)
end
end
|
.api_url=(value) ⇒ Object
39
40
41
|
# File 'lib/cronofy.rb', line 39
def self.api_url=(value)
@api_url = value
end
|
.api_url_for_data_center(dc) ⇒ Object
47
48
49
50
51
52
53
54
55
56
57
58
59
|
# File 'lib/cronofy.rb', line 47
def self.api_url_for_data_center(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
|
.api_url_for_data_centre ⇒ Object
43
44
45
|
# File 'lib/cronofy.rb', line 43
def self.api_url_for_data_centre
api_url_for_data_center
end
|
.app_url(data_center_override) ⇒ Object
61
62
63
64
65
66
67
|
# File 'lib/cronofy.rb', line 61
def self.app_url(data_center_override)
if data_center_override
app_url_for_data_center(data_center_override)
else
ENV['CRONOFY_APP_URL'] || app_url_for_data_center(default_data_center)
end
end
|
.app_url=(value) ⇒ Object
69
70
71
|
# File 'lib/cronofy.rb', line 69
def self.app_url=(value)
@app_url = value
end
|
.app_url_for_data_center(dc) ⇒ Object
77
78
79
80
81
82
83
84
85
86
87
88
89
|
# File 'lib/cronofy.rb', line 77
def self.app_url_for_data_center(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
|
.app_url_for_data_centre(dc) ⇒ Object
73
74
75
|
# File 'lib/cronofy.rb', line 73
def self.app_url_for_data_centre(dc)
app_url_for_data_center(dc)
end
|
.default_data_center ⇒ Object
23
24
25
|
# File 'lib/cronofy.rb', line 23
def self.default_data_center
@default_data_center || ENV['CRONOFY_DATA_CENTER'] || ENV['CRONOFY_DATA_CENTRE']
end
|
.default_data_center=(value) ⇒ Object
27
28
29
|
# File 'lib/cronofy.rb', line 27
def self.default_data_center=(value)
@default_data_center = value
end
|
.default_data_centre ⇒ Object
15
16
17
|
# File 'lib/cronofy.rb', line 15
def self.default_data_centre
default_data_center
end
|
.default_data_centre=(value) ⇒ Object
19
20
21
|
# File 'lib/cronofy.rb', line 19
def self.default_data_centre=(value)
default_data_center= value
end
|