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.



4443
4444
4445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4443

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



4441
4442
4443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4441

def value
  @value
end

Class Method Details

.ALLObject



4463
4464
4465
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4463

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



4448
4449
4450
4451
4452
4453
4454
4455
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4448

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



4458
4459
4460
4461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4458

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

.matchObject

Full match



4468
4469
4470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4468

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

.no_matchObject

Address does not match expected card values



4484
4485
4486
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4484

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

.partialObject

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



4474
4475
4476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4474

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

.unsupportedObject

Issuer does not support address verification



4479
4480
4481
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4479

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

Instance Method Details

#to_hashObject



4488
4489
4490
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4488

def to_hash
  value
end