Class: AdvancedBilling::ProformaInvoiceDiscountBreakout
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::ProformaInvoiceDiscountBreakout
- Defined in:
- lib/advanced_billing/models/proforma_invoice_discount_breakout.rb
Overview
ProformaInvoiceDiscountBreakout Model.
Instance Attribute Summary collapse
-
#discount_amount ⇒ String
TODO: Write general description for this method.
-
#eligible_amount ⇒ String
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(eligible_amount = SKIP, discount_amount = SKIP) ⇒ ProformaInvoiceDiscountBreakout
constructor
A new instance of ProformaInvoiceDiscountBreakout.
Methods inherited from BaseModel
Constructor Details
#initialize(eligible_amount = SKIP, discount_amount = SKIP) ⇒ ProformaInvoiceDiscountBreakout
Returns a new instance of ProformaInvoiceDiscountBreakout.
41 42 43 44 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 41 def initialize(eligible_amount = SKIP, discount_amount = SKIP) @eligible_amount = eligible_amount unless eligible_amount == SKIP @discount_amount = discount_amount unless discount_amount == SKIP end |
Instance Attribute Details
#discount_amount ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 18 def discount_amount @discount_amount end |
#eligible_amount ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 14 def eligible_amount @eligible_amount end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 47 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. eligible_amount = hash.key?('eligible_amount') ? hash['eligible_amount'] : SKIP discount_amount = hash.key?('discount_amount') ? hash['discount_amount'] : SKIP # Create object from extracted values. ProformaInvoiceDiscountBreakout.new(eligible_amount, discount_amount) end |
.names ⇒ Object
A mapping from model property names to API property names.
21 22 23 24 25 26 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 21 def self.names @_hash = {} if @_hash.nil? @_hash['eligible_amount'] = 'eligible_amount' @_hash['discount_amount'] = 'discount_amount' @_hash end |
.nullables ⇒ Object
An array for nullable fields
37 38 39 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 37 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
29 30 31 32 33 34 |
# File 'lib/advanced_billing/models/proforma_invoice_discount_breakout.rb', line 29 def self.optionals %w[ eligible_amount discount_amount ] end |