Class: Io::Flow::V0::Models::TaxVerificationResult

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

Returns a new instance of TaxVerificationResult.



15404
15405
15406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15404

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15402
15403
15404
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15402

def value
  @value
end

Class Method Details

.ALLObject



15424
15425
15426
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15424

def TaxVerificationResult.ALL
  @@all ||= [TaxVerificationResult.valid, TaxVerificationResult.invalid, TaxVerificationResult.unable_to_validate]
end

.apply(value) ⇒ Object

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



15409
15410
15411
15412
15413
15414
15415
15416
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15409

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

.from_string(value) ⇒ Object

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



15419
15420
15421
15422
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15419

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

.invalidObject



15432
15433
15434
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15432

def TaxVerificationResult.invalid
  @@_invalid ||= TaxVerificationResult.new('invalid')
end

.unable_to_validateObject



15436
15437
15438
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15436

def TaxVerificationResult.unable_to_validate
  @@_unable_to_validate ||= TaxVerificationResult.new('unable_to_validate')
end

.validObject



15428
15429
15430
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15428

def TaxVerificationResult.valid
  @@_valid ||= TaxVerificationResult.new('valid')
end

Instance Method Details

#to_hashObject



15440
15441
15442
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15440

def to_hash
  value
end