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.



15450
15451
15452
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15450

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



15448
15449
15450
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15448

def value
  @value
end

Class Method Details

.ALLObject



15470
15471
15472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15470

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



15455
15456
15457
15458
15459
15460
15461
15462
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15455

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



15465
15466
15467
15468
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15465

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.



15476
15477
15478
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15476

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

Instance Method Details

#to_hashObject



15480
15481
15482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15480

def to_hash
  value
end