lib/ragoon/services.rb in ragoon-0.8.1 vs lib/ragoon/services.rb in ragoon-1.0.0
- old
+ new
@@ -1,10 +1,10 @@
class Ragoon::Services
SERVICE_LOCATIONS = {
- schedule: '/cbpapi/schedule/api?',
- notification: '/cbpapi/notification/api?',
- workflow: '/cbpapi/workflow/api?',
+ schedule: '/cbpapi/schedule/api.csp?',
+ notification: '/cbpapi/notification/api.csp?',
+ workflow: '/cbpapi/workflow/api.csp?',
}.freeze
attr_reader :client, :action_type
def initialize(options = Ragoon.default_options)
@@ -12,11 +12,13 @@
@action_type = self.class.name.split('::').pop.downcase.to_sym
@client = Ragoon::Client.new(self.endpoint, options)
end
def endpoint
- "#{base_endpoint}#{SERVICE_LOCATIONS[action_type]}"
+ url = "#{base_endpoint}#{SERVICE_LOCATIONS[action_type]}"
+ url.gsub!('.csp', '') if @options[:version].to_i == 3
+ url
end
def self.start_and_end(date = Date.today)
{
start: date.to_time.utc,
@@ -47,7 +49,6 @@
def to_datetime_str(time)
return nil if time.nil?
time.utc.strftime('%FT%TZ')
end
-
end