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.



7739
7740
7741
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7739

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



7737
7738
7739
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7737

def value
  @value
end

Class Method Details

.ALLObject



7759
7760
7761
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7759

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



7744
7745
7746
7747
7748
7749
7750
7751
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7744

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



7754
7755
7756
7757
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7754

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

.matchObject

Full match



7764
7765
7766
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7764

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

.no_matchObject

Address does not match expected card values



7780
7781
7782
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7780

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

.partialObject

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



7770
7771
7772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7770

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

.unsupportedObject

Issuer does not support address verification



7775
7776
7777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7775

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

Instance Method Details

#to_hashObject



7784
7785
7786
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 7784

def to_hash
  value
end