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.



8347
8348
8349
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8347

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8345
8346
8347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8345

def value
  @value
end

Class Method Details

.ALLObject



8367
8368
8369
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8367

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



8352
8353
8354
8355
8356
8357
8358
8359
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8352

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



8362
8363
8364
8365
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8362

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

.matchObject

Full match



8372
8373
8374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8372

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

.no_matchObject

Address does not match expected card values



8388
8389
8390
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8388

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

.partialObject

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



8378
8379
8380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8378

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

.unsupportedObject

Issuer does not support address verification



8383
8384
8385
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8383

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

Instance Method Details

#to_hashObject



8392
8393
8394
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8392

def to_hash
  value
end