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.
12881 12882 12883 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12881 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
12879 12880 12881 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12879 def value @value end |
Class Method Details
.ALL ⇒ Object
12901 12902 12903 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12901 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
12886 12887 12888 12889 12890 12891 12892 12893 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12886 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
12896 12897 12898 12899 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12896 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
12906 12907 12908 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12906 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
12922 12923 12924 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12922 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
12912 12913 12914 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12912 def AvsCode.partial @@_partial ||= AvsCode.new('partial') end |
.unsupported ⇒ Object
Issuer does not support address verification
12917 12918 12919 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12917 def AvsCode.unsupported @@_unsupported ||= AvsCode.new('unsupported') end |
Instance Method Details
#to_hash ⇒ Object
12926 12927 12928 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12926 def to_hash value end |