Module: ComplyanceSDK::Models::Operation
- Defined in:
- lib/complyance_sdk/models/operation.rb
Overview
Operation enumeration
Constant Summary collapse
- SINGLE =
Single document operation
:single- BATCH =
Batch document operation
:batch
Class Method Summary collapse
-
.all ⇒ Array<Symbol>
Get all valid operations.
-
.normalize(operation) ⇒ Symbol?
Convert string to operation symbol.
-
.valid?(operation) ⇒ Boolean
Check if an operation is valid.
Class Method Details
.all ⇒ Array<Symbol>
Get all valid operations
16 17 18 |
# File 'lib/complyance_sdk/models/operation.rb', line 16 def self.all [SINGLE, BATCH] end |
.normalize(operation) ⇒ Symbol?
Convert string to operation symbol
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/complyance_sdk/models/operation.rb', line 33 def self.normalize(operation) return nil if operation.nil? case operation.to_s.downcase when "single" SINGLE when "batch" BATCH else operation.to_sym if valid?(operation) end end |
.valid?(operation) ⇒ Boolean
Check if an operation is valid
24 25 26 27 |
# File 'lib/complyance_sdk/models/operation.rb', line 24 def self.valid?(operation) return false if operation.nil? all.include?(operation.to_sym) end |