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.
7198 7199 7200 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7198 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7196 7197 7198 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7196 def value @value end |
Class Method Details
.ALL ⇒ Object
7218 7219 7220 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7218 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
7203 7204 7205 7206 7207 7208 7209 7210 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7203 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
7213 7214 7215 7216 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7213 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Full match
7223 7224 7225 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7223 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
7239 7240 7241 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7239 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
7229 7230 7231 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7229 def AvsCode.partial @@_partial ||= AvsCode.new('partial') end |
.unsupported ⇒ Object
Issuer does not support address verification
7234 7235 7236 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7234 def AvsCode.unsupported @@_unsupported ||= AvsCode.new('unsupported') end |
Instance Method Details
#to_hash ⇒ Object
7243 7244 7245 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7243 def to_hash value end |