Class: Ragoon::Services
- Inherits:
-
Object
- Object
- Ragoon::Services
- Defined in:
- lib/ragoon/services.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Notification, Schedule, Workflow
Constant Summary collapse
- SERVICE_LOCATIONS =
{ schedule: '/cbpapi/schedule/api.csp?', notification: '/cbpapi/notification/api.csp?', workflow: '/cbpapi/workflow/api.csp?', }.freeze
Instance Attribute Summary collapse
-
#action_type ⇒ Object
readonly
Returns the value of attribute action_type.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
- #endpoint ⇒ Object
- #garoon_endpoint ⇒ Object
-
#initialize(options = Ragoon.secret_options) ⇒ Services
constructor
A new instance of Services.
Constructor Details
Instance Attribute Details
#action_type ⇒ Object (readonly)
Returns the value of attribute action_type.
8 9 10 |
# File 'lib/ragoon/services.rb', line 8 def action_type @action_type end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/ragoon/services.rb', line 8 def client @client end |
Class Method Details
.start_and_end(date = Date.today) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/ragoon/services.rb', line 22 def self.start_and_end(date = Date.today) { start: date.to_time.utc, end: ((date + 1).to_time - 1).utc, } end |
Instance Method Details
#endpoint ⇒ Object
16 17 18 19 20 |
# File 'lib/ragoon/services.rb', line 16 def endpoint url = "#{base_endpoint}#{SERVICE_LOCATIONS[action_type]}" url.gsub!('.csp', '') if @options[:version].to_i == 3 url end |
#garoon_endpoint ⇒ Object
29 30 31 |
# File 'lib/ragoon/services.rb', line 29 def garoon_endpoint base_endpoint end |