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.



10372
10373
10374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10372

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



10370
10371
10372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10370

def value
  @value
end

Class Method Details

.ALLObject



10392
10393
10394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10392

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



10377
10378
10379
10380
10381
10382
10383
10384
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10377

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



10387
10388
10389
10390
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10387

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

.matchObject

Full match



10397
10398
10399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10397

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

.no_matchObject

Address does not match expected card values



10413
10414
10415
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10413

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

.partialObject

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



10403
10404
10405
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10403

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

.unsupportedObject

Issuer does not support address verification



10408
10409
10410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10408

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

Instance Method Details

#to_hashObject



10417
10418
10419
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10417

def to_hash
  value
end