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.



8558
8559
8560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8558

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8556
8557
8558
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8556

def value
  @value
end

Class Method Details

.ALLObject



8578
8579
8580
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8578

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



8563
8564
8565
8566
8567
8568
8569
8570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8563

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



8573
8574
8575
8576
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8573

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

.matchObject

Full match



8583
8584
8585
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8583

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

.no_matchObject

Address does not match expected card values



8599
8600
8601
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8599

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

.partialObject

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



8589
8590
8591
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8589

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

.unsupportedObject

Issuer does not support address verification



8594
8595
8596
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8594

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

Instance Method Details

#to_hashObject



8603
8604
8605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8603

def to_hash
  value
end