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 undestand 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.
6755 6756 6757 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6755 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6753 6754 6755 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6753 def value @value end |
Class Method Details
.ALL ⇒ Object
6775 6776 6777 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6775 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
6760 6761 6762 6763 6764 6765 6766 6767 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6760 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
6770 6771 6772 6773 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6770 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
6780 6781 6782 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6780 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
6796 6797 6798 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6796 def AvsCode.no_match @@_no_match ||= AvsCode.new('no_match') end |
Instance Method Details
#to_hash ⇒ Object
6800 6801 6802 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6800 def to_hash value end |