Class: NewStoreApi::TaxStatusEnum
- Inherits:
-
Object
- Object
- NewStoreApi::TaxStatusEnum
- Defined in:
- lib/new_store_api/models/tax_status_enum.rb
Overview
Type of the tax status applied to the tax line * TAXABLE: Taxes are
applied to the tax line. * NOT_TAXABLE: No taxes are applied to the tax
line. * EXEMPT: Taxes are exempt for the tax line.
Constant Summary collapse
- TAX_STATUS_ENUM =
[ # TODO: Write general description for EXEMPT EXEMPT = 'EXEMPT'.freeze, # TODO: Write general description for TAXABLE TAXABLE = 'TAXABLE'.freeze, # TODO: Write general description for NOT_TAXABLE NOT_TAXABLE = 'NOT_TAXABLE'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = EXEMPT) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/new_store_api/models/tax_status_enum.rb', line 28 def self.from_value(value, default_value = EXEMPT) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'exempt' then EXEMPT when 'taxable' then TAXABLE when 'not_taxable' then NOT_TAXABLE else default_value end end |
.validate(value) ⇒ Object
22 23 24 25 26 |
# File 'lib/new_store_api/models/tax_status_enum.rb', line 22 def self.validate(value) return false if value.nil? TAX_STATUS_ENUM.include?(value) end |