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.



6903
6904
6905
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6903

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6901
6902
6903
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6901

def value
  @value
end

Class Method Details

.ALLObject



6923
6924
6925
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6923

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



6908
6909
6910
6911
6912
6913
6914
6915
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6908

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



6918
6919
6920
6921
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6918

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

.matchObject

Full match



6928
6929
6930
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6928

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

.no_matchObject

Address does not match expected card values



6944
6945
6946
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6944

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

.partialObject

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



6934
6935
6936
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6934

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

.unsupportedObject

Issuer does not support address verification



6939
6940
6941
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6939

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

Instance Method Details

#to_hashObject



6948
6949
6950
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6948

def to_hash
  value
end