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.



15345
15346
15347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15345

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15343
15344
15345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15343

def value
  @value
end

Class Method Details

.ALLObject



15365
15366
15367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15365

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



15350
15351
15352
15353
15354
15355
15356
15357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15350

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



15360
15361
15362
15363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15360

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

.matchObject

Full match



15370
15371
15372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15370

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

.no_matchObject

Address does not match expected card values



15386
15387
15388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15386

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

.partialObject

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



15376
15377
15378
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15376

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

.unsupportedObject

Issuer does not support address verification



15381
15382
15383
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15381

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

Instance Method Details

#to_hashObject



15390
15391
15392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15390

def to_hash
  value
end