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.



17295
17296
17297
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17295

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17293
17294
17295
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17293

def value
  @value
end

Class Method Details

.ALLObject



17315
17316
17317
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17315

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



17300
17301
17302
17303
17304
17305
17306
17307
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17300

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



17310
17311
17312
17313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17310

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

.matchObject

Full match



17320
17321
17322
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17320

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

.no_matchObject

Address does not match expected card values



17336
17337
17338
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17336

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

.partialObject

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



17326
17327
17328
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17326

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

.unsupportedObject

Issuer does not support address verification



17331
17332
17333
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17331

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

Instance Method Details

#to_hashObject



17340
17341
17342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17340

def to_hash
  value
end