Class: Io::Flow::V0::Models::AvsCode

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ AvsCode

Returns a new instance of AvsCode.



7179
7180
7181
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7179

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7177
7178
7179
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7177

def value
  @value
end

Class Method Details

.ALLObject



7199
7200
7201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7199

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



7184
7185
7186
7187
7188
7189
7190
7191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7184

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



7194
7195
7196
7197
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7194

def AvsCode.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  AvsCode.ALL.find { |v| v.value == value }
end

.matchObject

Full match



7204
7205
7206
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7204

def AvsCode.match
  @@_match ||= AvsCode.new('match')
end

.no_matchObject

Address does not match expected card values



7220
7221
7222
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7220

def AvsCode.no_match
  @@_no_match ||= AvsCode.new('no_match')
end

.partialObject

Partial match; see details in ‘avs’ model to undestand which components matched



7210
7211
7212
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7210

def AvsCode.partial
  @@_partial ||= AvsCode.new('partial')
end

.unsupportedObject

Issuer does not support address verification



7215
7216
7217
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7215

def AvsCode.unsupported
  @@_unsupported ||= AvsCode.new('unsupported')
end

Instance Method Details

#to_hashObject



7224
7225
7226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7224

def to_hash
  value
end