Class: AdvancedBilling::TaxConfiguration
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::TaxConfiguration
- Defined in:
- lib/advanced_billing/models/tax_configuration.rb
Overview
TaxConfiguration Model.
Instance Attribute Summary collapse
-
#destination_address ⇒ TaxDestinationAddress
TODO: Write general description for this method.
-
#fully_configured ⇒ TrueClass | FalseClass
Returns ‘true` when Chargify has been properly configured to charge tax using the specified tax system.
-
#kind ⇒ TaxConfigurationKind
TODO: Write general description for this method.
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(kind = TaxConfigurationKind::CUSTOM, destination_address = SKIP, fully_configured = false) ⇒ TaxConfiguration
constructor
A new instance of TaxConfiguration.
Methods inherited from BaseModel
Constructor Details
#initialize(kind = TaxConfigurationKind::CUSTOM, destination_address = SKIP, fully_configured = false) ⇒ TaxConfiguration
Returns a new instance of TaxConfiguration.
50 51 52 53 54 55 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 50 def initialize(kind = TaxConfigurationKind::CUSTOM, destination_address = SKIP, fully_configured = false) @kind = kind unless kind == SKIP @destination_address = destination_address unless destination_address == SKIP @fully_configured = fully_configured unless fully_configured == SKIP end |
Instance Attribute Details
#destination_address ⇒ TaxDestinationAddress
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 18 def destination_address @destination_address end |
#fully_configured ⇒ TrueClass | FalseClass
Returns ‘true` when Chargify has been properly configured to charge tax using the specified tax system. More details about taxes: maxio-chargify.zendesk.com/hc/en-us/articles/5405488905869-Taxes-I ntroduction
25 26 27 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 25 def fully_configured @fully_configured end |
#kind ⇒ TaxConfigurationKind
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 14 def kind @kind end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 58 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. kind = hash['kind'] ||= TaxConfigurationKind::CUSTOM destination_address = hash.key?('destination_address') ? hash['destination_address'] : SKIP fully_configured = hash['fully_configured'] ||= false # Create object from extracted values. TaxConfiguration.new(kind, destination_address, fully_configured) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['kind'] = 'kind' @_hash['destination_address'] = 'destination_address' @_hash['fully_configured'] = 'fully_configured' @_hash end |
.nullables ⇒ Object
An array for nullable fields
46 47 48 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 46 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 40 41 42 43 |
# File 'lib/advanced_billing/models/tax_configuration.rb', line 37 def self.optionals %w[ kind destination_address fully_configured ] end |