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
Address matches expected values.
-
.no_match ⇒ Object
Address does not match expected card values.
-
.not_supported ⇒ 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.
4112 4113 4114 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4112 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
4110 4111 4112 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4110 def value @value end |
Class Method Details
.ALL ⇒ Object
4132 4133 4134 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4132 def AvsCode.ALL @@all ||= [AvsCode.match, AvsCode.no_match, AvsCode.not_supported] end |
.apply(value) ⇒ Object
Returns the instance of AvsCode for this value, creating a new instance for an unknown value
4117 4118 4119 4120 4121 4122 4123 4124 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4117 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
4127 4128 4129 4130 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4127 def AvsCode.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) AvsCode.ALL.find { |v| v.value == value } end |
.match ⇒ Object
Address matches expected values
4137 4138 4139 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4137 def AvsCode.match @@_match ||= AvsCode.new('match') end |
.no_match ⇒ Object
Address does not match expected card values
4142 4143 4144 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4142 def AvsCode.no_match @@_no_match ||= AvsCode.new('no_match') end |
.not_supported ⇒ Object
Issuer does not support address verification
4147 4148 4149 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4147 def AvsCode.not_supported @@_not_supported ||= AvsCode.new('not_supported') end |
Instance Method Details
#to_hash ⇒ Object
4151 4152 4153 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4151 def to_hash value end |