Class: ApiReference::NewNumeralConfiguration

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/new_numeral_configuration.rb

Overview

NewNumeralConfiguration Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Returns a new instance of NewNumeralConfiguration.



51
52
53
54
55
56
57
58
59
60
# File 'lib/api_reference/models/new_numeral_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 = 'numeral'
  @additional_properties = additional_properties
end

Instance Attribute Details

#automatic_tax_enabledTrueClass | FalseClass

Whether to automatically calculate tax for this customer. When null, inherits from account-level setting. When true or false, overrides the account setting.

Returns:

  • (TrueClass | FalseClass)


20
21
22
# File 'lib/api_reference/models/new_numeral_configuration.rb', line 20

def automatic_tax_enabled
  @automatic_tax_enabled
end

#tax_exemptTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


14
15
16
# File 'lib/api_reference/models/new_numeral_configuration.rb', line 14

def tax_exempt
  @tax_exempt
end

#tax_providerString (readonly)

Whether to automatically calculate tax for this customer. When null, inherits from account-level setting. When true or false, overrides the account setting.

Returns:

  • (String)


26
27
28
# File 'lib/api_reference/models/new_numeral_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_numeral_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.
  NewNumeralConfiguration.new(tax_exempt: tax_exempt,
                              automatic_tax_enabled: automatic_tax_enabled,
                              additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
# File 'lib/api_reference/models/new_numeral_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

.nullablesObject

An array for nullable fields



45
46
47
48
49
# File 'lib/api_reference/models/new_numeral_configuration.rb', line 45

def self.nullables
  %w[
    automatic_tax_enabled
  ]
end

.optionalsObject

An array for optional fields



38
39
40
41
42
# File 'lib/api_reference/models/new_numeral_configuration.rb', line 38

def self.optionals
  %w[
    automatic_tax_enabled
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



93
94
95
96
97
98
# File 'lib/api_reference/models/new_numeral_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_sObject

Provides a human-readable string representation of the object.



85
86
87
88
89
90
# File 'lib/api_reference/models/new_numeral_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