Module: Sift
- Defined in:
- lib/sift.rb,
lib/sift/error.rb,
lib/sift/client.rb,
lib/sift/router.rb,
lib/sift/version.rb,
lib/sift/client/decision.rb,
lib/sift/utils/hash_getter.rb,
lib/sift/validate/decision.rb,
lib/sift/validate/primitive.rb,
lib/sift/client/decision/apply_to.rb
Defined Under Namespace
Modules: Utils, Validate Classes: ApiError, Client, Error, Response, Router
Constant Summary collapse
- VERSION =
"2.2.1"- API_VERSION =
"204"
Class Attribute Summary collapse
-
.account_id ⇒ Object
Returns the value of attribute account_id.
-
.api_key ⇒ Object
Returns the value of attribute api_key.
Class Method Summary collapse
- .error(msg) ⇒ Object
- .fatal(msg) ⇒ Object
- .info(msg) ⇒ Object
-
.logger=(logger) ⇒ Object
Sets the Output logger to use within the client.
-
.order_decisions_api_path(account_id, order_id) ⇒ Object
Returns the path for Orders Decisions API.
-
.rest_api_path(version = API_VERSION) ⇒ Object
Returns the path for the specified API version.
-
.score_api_path(user_id, version = API_VERSION) ⇒ Object
Returns the Score API path for the specified user ID and API version.
-
.user_decisions_api_path(account_id, user_id) ⇒ Object
Returns the path for User Decisions API.
-
.users_label_api_path(user_id, version = API_VERSION) ⇒ Object
Returns the users API path for the specified user ID and API version.
- .warn(msg) ⇒ Object
-
.workflow_status_path(account_id, run_id) ⇒ Object
Returns the path for the Workflow Status API.
Class Attribute Details
.account_id ⇒ Object
Returns the value of attribute account_id.
43 44 45 |
# File 'lib/sift.rb', line 43 def account_id @account_id end |
.api_key ⇒ Object
Returns the value of attribute api_key.
38 39 40 |
# File 'lib/sift.rb', line 38 def api_key @api_key end |
Class Method Details
.error(msg) ⇒ Object
60 61 62 |
# File 'lib/sift.rb', line 60 def self.error(msg) @logger.error(msg) if @logger end |
.fatal(msg) ⇒ Object
64 65 66 |
# File 'lib/sift.rb', line 64 def self.fatal(msg) @logger.fatal(msg) if @logger end |
.info(msg) ⇒ Object
52 53 54 |
# File 'lib/sift.rb', line 52 def self.info(msg) @logger.info(msg) if @logger end |
.logger=(logger) ⇒ Object
Sets the Output logger to use within the client. This can be left uninitializaed but is useful for debugging.
48 49 50 |
# File 'lib/sift.rb', line 48 def self.logger=(logger) @logger = logger end |
.order_decisions_api_path(account_id, order_id) ⇒ Object
Returns the path for Orders Decisions API
32 33 34 |
# File 'lib/sift.rb', line 32 def self.order_decisions_api_path(account_id, order_id) "/v3/accounts/#{account_id}/orders/#{order_id}/decisions" end |
.rest_api_path(version = API_VERSION) ⇒ Object
Returns the path for the specified API version
7 8 9 |
# File 'lib/sift.rb', line 7 def self.rest_api_path(version=API_VERSION) "/v#{version}/events" end |
.score_api_path(user_id, version = API_VERSION) ⇒ Object
Returns the Score API path for the specified user ID and API version
12 13 14 |
# File 'lib/sift.rb', line 12 def self.score_api_path(user_id, version=API_VERSION) "/v#{version}/score/#{URI.encode(user_id)}/" end |
.user_decisions_api_path(account_id, user_id) ⇒ Object
Returns the path for User Decisions API
27 28 29 |
# File 'lib/sift.rb', line 27 def self.user_decisions_api_path(account_id, user_id) "/v3/accounts/#{account_id}/users/#{user_id}/decisions" end |
.users_label_api_path(user_id, version = API_VERSION) ⇒ Object
Returns the users API path for the specified user ID and API version
17 18 19 |
# File 'lib/sift.rb', line 17 def self.users_label_api_path(user_id, version=API_VERSION) "/v#{version}/users/#{URI.encode(user_id)}/labels" end |
.warn(msg) ⇒ Object
56 57 58 |
# File 'lib/sift.rb', line 56 def self.warn(msg) @logger.warn(msg) if @logger end |
.workflow_status_path(account_id, run_id) ⇒ Object
Returns the path for the Workflow Status API
22 23 24 |
# File 'lib/sift.rb', line 22 def self.workflow_status_path(account_id, run_id) "/v3/accounts/#{account_id}/workflows/runs/#{run_id}" end |