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