Class: AdvancedBilling::InvoiceTaxComponentBreakout
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::InvoiceTaxComponentBreakout
- Defined in:
- lib/advanced_billing/models/invoice_tax_component_breakout.rb
Overview
InvoiceTaxComponentBreakout Model.
Instance Attribute Summary collapse
-
#country_code ⇒ String
TODO: Write general description for this method.
-
#percentage ⇒ String
TODO: Write general description for this method.
-
#subdivision_code ⇒ String
TODO: Write general description for this method.
-
#tax_rule_id ⇒ Integer
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(tax_rule_id = SKIP, percentage = SKIP, country_code = SKIP, subdivision_code = SKIP) ⇒ InvoiceTaxComponentBreakout
constructor
A new instance of InvoiceTaxComponentBreakout.
Methods inherited from BaseModel
Constructor Details
#initialize(tax_rule_id = SKIP, percentage = SKIP, country_code = SKIP, subdivision_code = SKIP) ⇒ InvoiceTaxComponentBreakout
Returns a new instance of InvoiceTaxComponentBreakout.
53 54 55 56 57 58 59 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 53 def initialize(tax_rule_id = SKIP, percentage = SKIP, country_code = SKIP, subdivision_code = SKIP) @tax_rule_id = tax_rule_id unless tax_rule_id == SKIP @percentage = percentage unless percentage == SKIP @country_code = country_code unless country_code == SKIP @subdivision_code = subdivision_code unless subdivision_code == SKIP end |
Instance Attribute Details
#country_code ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 22 def country_code @country_code end |
#percentage ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 18 def percentage @percentage end |
#subdivision_code ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 26 def subdivision_code @subdivision_code end |
#tax_rule_id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 14 def tax_rule_id @tax_rule_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 62 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. tax_rule_id = hash.key?('tax_rule_id') ? hash['tax_rule_id'] : SKIP percentage = hash.key?('percentage') ? hash['percentage'] : SKIP country_code = hash.key?('country_code') ? hash['country_code'] : SKIP subdivision_code = hash.key?('subdivision_code') ? hash['subdivision_code'] : SKIP # Create object from extracted values. InvoiceTaxComponentBreakout.new(tax_rule_id, percentage, country_code, subdivision_code) end |
.names ⇒ Object
A mapping from model property names to API property names.
29 30 31 32 33 34 35 36 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 29 def self.names @_hash = {} if @_hash.nil? @_hash['tax_rule_id'] = 'tax_rule_id' @_hash['percentage'] = 'percentage' @_hash['country_code'] = 'country_code' @_hash['subdivision_code'] = 'subdivision_code' @_hash end |
.nullables ⇒ Object
An array for nullable fields
49 50 51 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 49 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 39 def self.optionals %w[ tax_rule_id percentage country_code subdivision_code ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
81 82 83 84 85 86 87 |
# File 'lib/advanced_billing/models/invoice_tax_component_breakout.rb', line 81 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |