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.



18526
18527
18528
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18526

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18524
18525
18526
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18524

def value
  @value
end

Class Method Details

.ALLObject



18546
18547
18548
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18546

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



18531
18532
18533
18534
18535
18536
18537
18538
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18531

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



18541
18542
18543
18544
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18541

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

.invalidObject



18554
18555
18556
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18554

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

.unable_to_validateObject



18558
18559
18560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18558

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

.validObject



18550
18551
18552
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18550

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

Instance Method Details

#to_hashObject



18562
18563
18564
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18562

def to_hash
  value
end