Class: ComplyanceSDK::Models::PolicyResult
- Inherits:
-
Object
- Object
- ComplyanceSDK::Models::PolicyResult
- Defined in:
- lib/complyance_sdk/models/policy_result.rb
Overview
Result of evaluating a logical document type policy Contains the base document type and meta configuration flags
Instance Attribute Summary collapse
-
#base_type ⇒ Object
readonly
Returns the value of attribute base_type.
-
#document_type ⇒ Object
readonly
Returns the value of attribute document_type.
-
#meta_config_flags ⇒ Object
readonly
Returns the value of attribute meta_config_flags.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Equality comparison.
-
#adjusted? ⇒ Boolean
Check if this is an adjusted type.
-
#b2b? ⇒ Boolean
Check if this is a B2B type.
-
#base_document_type ⇒ Symbol
Get the base document type.
-
#export? ⇒ Boolean
Check if this is an export type.
-
#get_document_type ⇒ String
Get document type string.
-
#get_meta_config_flags ⇒ Hash
Get meta configuration flags.
-
#hash ⇒ Integer
Hash code for equality.
-
#initialize(base_type, meta_config_flags, document_type) ⇒ PolicyResult
constructor
Initialize a new policy result.
-
#nominal_supply? ⇒ Boolean
Check if this is a nominal supply type.
-
#prepayment? ⇒ Boolean
Check if this is a prepayment type.
-
#receipt? ⇒ Boolean
Check if this is a receipt type.
-
#self_billed? ⇒ Boolean
Check if this is a self-billed type.
-
#summary? ⇒ Boolean
Check if this is a summary type.
-
#third_party? ⇒ Boolean
Check if this is a third party type.
-
#to_h ⇒ Hash
Convert to hash representation.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(base_type, meta_config_flags, document_type) ⇒ PolicyResult
Initialize a new policy result
17 18 19 20 21 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 17 def initialize(base_type, , document_type) @base_type = base_type @meta_config_flags = || {} @document_type = document_type end |
Instance Attribute Details
#base_type ⇒ Object (readonly)
Returns the value of attribute base_type.
10 11 12 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 10 def base_type @base_type end |
#document_type ⇒ Object (readonly)
Returns the value of attribute document_type.
10 11 12 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 10 def document_type @document_type end |
#meta_config_flags ⇒ Object (readonly)
Returns the value of attribute meta_config_flags.
10 11 12 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 10 def @meta_config_flags end |
Instance Method Details
#==(other) ⇒ Boolean
Equality comparison
129 130 131 132 133 134 135 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 129 def ==(other) return false unless other.is_a?(PolicyResult) @base_type == other.base_type && @meta_config_flags == other. && @document_type == other.document_type end |
#adjusted? ⇒ Boolean
Check if this is an adjusted type
96 97 98 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 96 def adjusted? @meta_config_flags[:isAdjusted] == true end |
#b2b? ⇒ Boolean
Check if this is a B2B type
82 83 84 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 82 def b2b? @meta_config_flags[:isB2B] == true end |
#base_document_type ⇒ Symbol
Get the base document type
26 27 28 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 26 def base_document_type @base_type end |
#export? ⇒ Boolean
Check if this is an export type
47 48 49 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 47 def export? @meta_config_flags[:isExport] == true end |
#get_document_type ⇒ String
Get document type string
40 41 42 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 40 def get_document_type @document_type end |
#get_meta_config_flags ⇒ Hash
Get meta configuration flags
33 34 35 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 33 def @meta_config_flags.dup end |
#hash ⇒ Integer
Hash code for equality
140 141 142 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 140 def hash [@base_type, @meta_config_flags, @document_type].hash end |
#nominal_supply? ⇒ Boolean
Check if this is a nominal supply type
68 69 70 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 68 def nominal_supply? @meta_config_flags[:isNominal] == true end |
#prepayment? ⇒ Boolean
Check if this is a prepayment type
89 90 91 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 89 def prepayment? @meta_config_flags[:isPrepayment] == true end |
#receipt? ⇒ Boolean
Check if this is a receipt type
103 104 105 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 103 def receipt? @meta_config_flags[:isReceipt] == true end |
#self_billed? ⇒ Boolean
Check if this is a self-billed type
54 55 56 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 54 def self_billed? @meta_config_flags[:isSelfBilled] == true end |
#summary? ⇒ Boolean
Check if this is a summary type
75 76 77 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 75 def summary? @meta_config_flags[:isSummary] == true end |
#third_party? ⇒ Boolean
Check if this is a third party type
61 62 63 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 61 def third_party? @meta_config_flags[:isThirdParty] == true end |
#to_h ⇒ Hash
Convert to hash representation
110 111 112 113 114 115 116 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 110 def to_h { base_type: @base_type, meta_config_flags: @meta_config_flags, document_type: @document_type } end |
#to_s ⇒ String
String representation
121 122 123 |
# File 'lib/complyance_sdk/models/policy_result.rb', line 121 def to_s "PolicyResult{base_type=#{@base_type}, document_type=#{@document_type}, flags=#{@meta_config_flags}}" end |