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.



7398
7399
7400
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7398

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7396
7397
7398
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7396

def value
  @value
end

Class Method Details

.ALLObject



7418
7419
7420
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7418

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



7403
7404
7405
7406
7407
7408
7409
7410
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7403

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



7413
7414
7415
7416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7413

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

.matchObject

Full match



7423
7424
7425
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7423

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

.no_matchObject

Address does not match expected card values



7439
7440
7441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7439

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

.partialObject

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



7429
7430
7431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7429

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

.unsupportedObject

Issuer does not support address verification



7434
7435
7436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7434

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

Instance Method Details

#to_hashObject



7443
7444
7445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7443

def to_hash
  value
end