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.



16471
16472
16473
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16471

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16469
16470
16471
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16469

def value
  @value
end

Class Method Details

.ALLObject



16491
16492
16493
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16491

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



16476
16477
16478
16479
16480
16481
16482
16483
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16476

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



16486
16487
16488
16489
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16486

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

.invalidObject



16499
16500
16501
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16499

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

.unable_to_validateObject



16503
16504
16505
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16503

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

.validObject



16495
16496
16497
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16495

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

Instance Method Details

#to_hashObject



16507
16508
16509
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16507

def to_hash
  value
end