Class: ApiReference::NewTaxJarConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::NewTaxJarConfiguration
- Defined in:
- lib/api_reference/models/new_tax_jar_configuration.rb
Overview
NewTaxJarConfiguration Model.
Instance Attribute Summary collapse
-
#automatic_tax_enabled ⇒ TrueClass | FalseClass
Whether to automatically calculate tax for this customer.
-
#tax_exempt ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#tax_provider ⇒ String
readonly
Whether to automatically calculate tax for this customer.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(tax_exempt:, automatic_tax_enabled: SKIP, additional_properties: nil) ⇒ NewTaxJarConfiguration
constructor
A new instance of NewTaxJarConfiguration.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(tax_exempt:, automatic_tax_enabled: SKIP, additional_properties: nil) ⇒ NewTaxJarConfiguration
Returns a new instance of NewTaxJarConfiguration.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 51 def initialize(tax_exempt:, automatic_tax_enabled: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @tax_exempt = tax_exempt @automatic_tax_enabled = automatic_tax_enabled unless automatic_tax_enabled == SKIP @tax_provider = 'taxjar' @additional_properties = additional_properties end |
Instance Attribute Details
#automatic_tax_enabled ⇒ TrueClass | FalseClass
Whether to automatically calculate tax for this customer. When null, inherits from account-level setting. When true or false, overrides the account setting.
20 21 22 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 20 def automatic_tax_enabled @automatic_tax_enabled end |
#tax_exempt ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 14 def tax_exempt @tax_exempt end |
#tax_provider ⇒ String (readonly)
Whether to automatically calculate tax for this customer. When null, inherits from account-level setting. When true or false, overrides the account setting.
26 27 28 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 26 def tax_provider @tax_provider end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 63 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. tax_exempt = hash.key?('tax_exempt') ? hash['tax_exempt'] : nil automatic_tax_enabled = hash.key?('automatic_tax_enabled') ? hash['automatic_tax_enabled'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. NewTaxJarConfiguration.new(tax_exempt: tax_exempt, automatic_tax_enabled: automatic_tax_enabled, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['tax_exempt'] = 'tax_exempt' @_hash['automatic_tax_enabled'] = 'automatic_tax_enabled' @_hash['tax_provider'] = 'tax_provider' @_hash end |
.nullables ⇒ Object
An array for nullable fields
45 46 47 48 49 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 45 def self.nullables %w[ automatic_tax_enabled ] end |
.optionals ⇒ Object
An array for optional fields
38 39 40 41 42 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 38 def self.optionals %w[ automatic_tax_enabled ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
93 94 95 96 97 98 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 93 def inspect class_name = self.class.name.split('::').last "<#{class_name} tax_exempt: #{@tax_exempt.inspect}, automatic_tax_enabled:"\ " #{@automatic_tax_enabled.inspect}, tax_provider: #{@tax_provider.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
85 86 87 88 89 90 |
# File 'lib/api_reference/models/new_tax_jar_configuration.rb', line 85 def to_s class_name = self.class.name.split('::').last "<#{class_name} tax_exempt: #{@tax_exempt}, automatic_tax_enabled:"\ " #{@automatic_tax_enabled}, tax_provider: #{@tax_provider}, additional_properties:"\ " #{@additional_properties}>" end |