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.



13273
13274
13275
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13273

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13271
13272
13273
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13271

def value
  @value
end

Class Method Details

.ALLObject



13293
13294
13295
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13293

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



13278
13279
13280
13281
13282
13283
13284
13285
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13278

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



13288
13289
13290
13291
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13288

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

.matchObject

Full match



13298
13299
13300
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13298

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

.no_matchObject

Address does not match expected card values



13314
13315
13316
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13314

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

.partialObject

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



13304
13305
13306
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13304

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

.unsupportedObject

Issuer does not support address verification



13309
13310
13311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13309

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

Instance Method Details

#to_hashObject



13318
13319
13320
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13318

def to_hash
  value
end