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.
6517 6518 6519 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6517 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6515 6516 6517 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6515 def value @value end |
Class Method Details
.ALL ⇒ Object
6537 6538 6539 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6537 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
6522 6523 6524 6525 6526 6527 6528 6529 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6522 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
6532 6533 6534 6535 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6532 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
6542 6543 6544 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6542 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
6558 6559 6560 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6558 def AvsCode.no_match @@_no_match ||= AvsCode.new('no_match') end |
.partial ⇒ Object
Partial match; see details in ‘avs’ model to undestand which components matched
6548 6549 6550 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6548 def AvsCode.partial @@_partial ||= AvsCode.new('partial') end |
.unsupported ⇒ Object
Issuer does not support address verification
6553 6554 6555 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6553 def AvsCode.unsupported @@_unsupported ||= AvsCode.new('unsupported') end |
Instance Method Details
#to_hash ⇒ Object
6562 6563 6564 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6562 def to_hash value end |