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.



16068
16069
16070
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16068

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16066
16067
16068
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16066

def value
  @value
end

Class Method Details

.ALLObject



16088
16089
16090
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16088

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



16073
16074
16075
16076
16077
16078
16079
16080
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16073

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



16083
16084
16085
16086
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16083

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

.matchObject

Full match



16093
16094
16095
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16093

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

.no_matchObject

Address does not match expected card values



16109
16110
16111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16109

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

.partialObject

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



16099
16100
16101
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16099

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

.unsupportedObject

Issuer does not support address verification



16104
16105
16106
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16104

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

Instance Method Details

#to_hashObject



16113
16114
16115
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16113

def to_hash
  value
end