Class: Io::Flow::V0::Models::TaxabilityType

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

Returns a new instance of TaxabilityType.



14826
14827
14828
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14826

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



14824
14825
14826
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14824

def value
  @value
end

Class Method Details

.ALLObject



14846
14847
14848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14846

def TaxabilityType.ALL
  @@all ||= [TaxabilityType.tax_rule]
end

.apply(value) ⇒ Object

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



14831
14832
14833
14834
14835
14836
14837
14838
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14831

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

.from_string(value) ⇒ Object

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



14841
14842
14843
14844
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14841

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

.tax_ruleObject

Rule indicating how taxes should be applied. Acceptable values are defined by the ‘taxability_value’ enum.



14852
14853
14854
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14852

def TaxabilityType.tax_rule
  @@_tax_rule ||= TaxabilityType.new('tax_rule')
end

Instance Method Details

#to_hashObject



14856
14857
14858
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14856

def to_hash
  value
end