Class: Io::Flow::V0::Models::AvsCode
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::AvsCode
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of AvsCode for this value, creating a new instance for an unknown value.
-
.from_string(value) ⇒ Object
Returns the instance of AvsCode for this value, or nil if not found.
-
.match ⇒ Object
Full match.
-
.no_match ⇒ Object
Address does not match expected card values.
-
.partial ⇒ Object
Partial match; see details in ‘avs’ model to understand which components matched.
-
.unsupported ⇒ Object
Issuer does not support address verification.
Instance Method Summary collapse
-
#initialize(value) ⇒ AvsCode
constructor
A new instance of AvsCode.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ AvsCode
Returns a new instance of AvsCode.
10882 10883 10884 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10882 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
10880 10881 10882 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10880 def value @value end |
Class Method Details
.ALL ⇒ Object
10902 10903 10904 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10902 def AvsCode.ALL @@all ||= [AvsCode.match, AvsCode.partial, AvsCode.unsupported, AvsCode.no_match] end |
.apply(value) ⇒ Object
Returns the instance of AvsCode for this value, creating a new instance for an unknown value
10887 10888 10889 10890 10891 10892 10893 10894 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10887 def AvsCode.apply(value) if value.instance_of?(AvsCode) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || AvsCode.new(value)) end end |
.from_string(value) ⇒ Object
Returns the instance of AvsCode for this value, or nil if not found
10897 10898 10899 10900 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10897 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
10907 10908 10909 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10907 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
10923 10924 10925 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10923 def AvsCode.no_match @@_no_match ||= AvsCode.new('no_match') end |
.partial ⇒ Object
Partial match; see details in ‘avs’ model to understand which components matched
10913 10914 10915 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10913 def AvsCode.partial @@_partial ||= AvsCode.new('partial') end |
.unsupported ⇒ Object
Issuer does not support address verification
10918 10919 10920 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10918 def AvsCode.unsupported @@_unsupported ||= AvsCode.new('unsupported') end |
Instance Method Details
#to_hash ⇒ Object
10927 10928 10929 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10927 def to_hash value end |