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



9523
9524
9525
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9523

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9521
9522
9523
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9521

def value
  @value
end

Class Method Details

.ALLObject



9543
9544
9545
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9543

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



9528
9529
9530
9531
9532
9533
9534
9535
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9528

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



9538
9539
9540
9541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9538

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

.matchObject

Full match



9548
9549
9550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9548

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

.no_matchObject

Address does not match expected card values



9564
9565
9566
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9564

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

.partialObject

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



9554
9555
9556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9554

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

.unsupportedObject

Issuer does not support address verification



9559
9560
9561
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9559

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

Instance Method Details

#to_hashObject



9568
9569
9570
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9568

def to_hash
  value
end