Class: Io::Flow::V0::Models::CvvCode

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) ⇒ CvvCode

Returns a new instance of CvvCode.



4355
4356
4357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4355

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



4353
4354
4355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4353

def value
  @value
end

Class Method Details

.ALLObject



4375
4376
4377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4375

def CvvCode.ALL
  @@all ||= [CvvCode.match, CvvCode.no_match, CvvCode.not_supported]
end

.apply(value) ⇒ Object

Returns the instance of CvvCode for this value, creating a new instance for an unknown value



4360
4361
4362
4363
4364
4365
4366
4367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4360

def CvvCode.apply(value)
  if value.instance_of?(CvvCode)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || CvvCode.new(value))
  end
end

.from_string(value) ⇒ Object

Returns the instance of CvvCode for this value, or nil if not found



4370
4371
4372
4373
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4370

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

.matchObject

CVV matches



4380
4381
4382
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4380

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

.no_matchObject

CVV did not match



4385
4386
4387
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4385

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

.not_supportedObject

Issuer does not support card verification numbers



4390
4391
4392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4390

def CvvCode.not_supported
  @@_not_supported ||= CvvCode.new('not_supported')
end

Instance Method Details

#to_hashObject



4394
4395
4396
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4394

def to_hash
  value
end