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



20954
20955
20956
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20954

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



20952
20953
20954
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20952

def value
  @value
end

Class Method Details

.ALLObject



20974
20975
20976
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20974

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



20959
20960
20961
20962
20963
20964
20965
20966
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20959

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



20969
20970
20971
20972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20969

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

.invalidObject



20982
20983
20984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20982

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

.unable_to_validateObject



20986
20987
20988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20986

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

.validObject



20978
20979
20980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20978

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

Instance Method Details

#to_hashObject



20990
20991
20992
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 20990

def to_hash
  value
end