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.



13661
13662
13663
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13661

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13659
13660
13661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13659

def value
  @value
end

Class Method Details

.ALLObject



13681
13682
13683
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13681

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



13666
13667
13668
13669
13670
13671
13672
13673
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13666

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



13676
13677
13678
13679
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13676

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

.matchObject

Full match



13686
13687
13688
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13686

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

.no_matchObject

Address does not match expected card values



13702
13703
13704
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13702

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

.partialObject

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



13692
13693
13694
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13692

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

.unsupportedObject

Issuer does not support address verification



13697
13698
13699
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13697

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

Instance Method Details

#to_hashObject



13706
13707
13708
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13706

def to_hash
  value
end