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.
9883 9884 9885 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9883 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
9881 9882 9883 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9881 def value @value end |
Class Method Details
.ALL ⇒ Object
9903 9904 9905 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9903 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
9888 9889 9890 9891 9892 9893 9894 9895 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9888 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
9898 9899 9900 9901 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9898 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
9908 9909 9910 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9908 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
9924 9925 9926 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9924 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
9914 9915 9916 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9914 def AvsCode.partial @@_partial ||= AvsCode.new('partial') end |
.unsupported ⇒ Object
Issuer does not support address verification
9919 9920 9921 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9919 def AvsCode.unsupported @@_unsupported ||= AvsCode.new('unsupported') end |
Instance Method Details
#to_hash ⇒ Object
9928 9929 9930 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9928 def to_hash value end |