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.



5965
5966
5967
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5965

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



5963
5964
5965
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5963

def value
  @value
end

Class Method Details

.ALLObject



5985
5986
5987
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5985

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



5970
5971
5972
5973
5974
5975
5976
5977
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5970

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



5980
5981
5982
5983
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5980

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

.matchObject

Full match



5990
5991
5992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5990

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

.no_matchObject

Address does not match expected card values



6006
6007
6008
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6006

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

.partialObject

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



5996
5997
5998
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5996

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

.unsupportedObject

Issuer does not support address verification



6001
6002
6003
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6001

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

Instance Method Details

#to_hashObject



6010
6011
6012
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 6010

def to_hash
  value
end