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.
8650 8651 8652 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8650 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
8648 8649 8650 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8648 def value @value end |
Class Method Details
.ALL ⇒ Object
8670 8671 8672 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8670 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
8655 8656 8657 8658 8659 8660 8661 8662 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8655 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
8665 8666 8667 8668 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8665 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
8675 8676 8677 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8675 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
8691 8692 8693 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8691 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
8681 8682 8683 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8681 def AvsCode.partial @@_partial ||= AvsCode.new('partial') end |
.unsupported ⇒ Object
Issuer does not support address verification
8686 8687 8688 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8686 def AvsCode.unsupported @@_unsupported ||= AvsCode.new('unsupported') end |
Instance Method Details
#to_hash ⇒ Object
8695 8696 8697 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8695 def to_hash value end |