Class: AdvancedBilling::BillingManifestItem
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::BillingManifestItem
- Defined in:
- lib/advanced_billing/models/billing_manifest_item.rb
Overview
BillingManifestItem Model.
Instance Attribute Summary collapse
-
#amount_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#component_handle ⇒ String
TODO: Write general description for this method.
-
#component_id ⇒ Integer
TODO: Write general description for this method.
-
#component_name ⇒ String
TODO: Write general description for this method.
-
#discount_amount_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#kind ⇒ String
TODO: Write general description for this method.
-
#memo ⇒ String
TODO: Write general description for this method.
-
#period_range_end ⇒ String
TODO: Write general description for this method.
-
#period_range_start ⇒ String
TODO: Write general description for this method.
-
#product_handle ⇒ String
TODO: Write general description for this method.
-
#product_id ⇒ Integer
TODO: Write general description for this method.
-
#product_name ⇒ String
TODO: Write general description for this method.
-
#taxable_amount_in_cents ⇒ Integer
TODO: Write general description for this method.
-
#transaction_type ⇒ 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(transaction_type = SKIP, kind = SKIP, amount_in_cents = SKIP, memo = SKIP, discount_amount_in_cents = SKIP, taxable_amount_in_cents = SKIP, component_id = SKIP, component_handle = SKIP, component_name = SKIP, product_id = SKIP, product_handle = SKIP, product_name = SKIP, period_range_start = SKIP, period_range_end = SKIP) ⇒ BillingManifestItem
constructor
A new instance of BillingManifestItem.
Methods inherited from BaseModel
Constructor Details
#initialize(transaction_type = SKIP, kind = SKIP, amount_in_cents = SKIP, memo = SKIP, discount_amount_in_cents = SKIP, taxable_amount_in_cents = SKIP, component_id = SKIP, component_handle = SKIP, component_name = SKIP, product_id = SKIP, product_handle = SKIP, product_name = SKIP, period_range_start = SKIP, period_range_end = SKIP) ⇒ BillingManifestItem
Returns a new instance of BillingManifestItem.
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 113 def initialize(transaction_type = SKIP, kind = SKIP, amount_in_cents = SKIP, memo = SKIP, discount_amount_in_cents = SKIP, taxable_amount_in_cents = SKIP, component_id = SKIP, component_handle = SKIP, component_name = SKIP, product_id = SKIP, product_handle = SKIP, product_name = SKIP, period_range_start = SKIP, period_range_end = SKIP) @transaction_type = transaction_type unless transaction_type == SKIP @kind = kind unless kind == SKIP @amount_in_cents = amount_in_cents unless amount_in_cents == SKIP @memo = memo unless memo == SKIP @discount_amount_in_cents = discount_amount_in_cents unless discount_amount_in_cents == SKIP @taxable_amount_in_cents = taxable_amount_in_cents unless taxable_amount_in_cents == SKIP @component_id = component_id unless component_id == SKIP @component_handle = component_handle unless component_handle == SKIP @component_name = component_name unless component_name == SKIP @product_id = product_id unless product_id == SKIP @product_handle = product_handle unless product_handle == SKIP @product_name = product_name unless product_name == SKIP @period_range_start = period_range_start unless period_range_start == SKIP @period_range_end = period_range_end unless period_range_end == SKIP end |
Instance Attribute Details
#amount_in_cents ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 22 def amount_in_cents @amount_in_cents end |
#component_handle ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 42 def component_handle @component_handle end |
#component_id ⇒ Integer
TODO: Write general description for this method
38 39 40 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 38 def component_id @component_id end |
#component_name ⇒ String
TODO: Write general description for this method
46 47 48 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 46 def component_name @component_name end |
#discount_amount_in_cents ⇒ Integer
TODO: Write general description for this method
30 31 32 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 30 def discount_amount_in_cents @discount_amount_in_cents end |
#kind ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 18 def kind @kind end |
#memo ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 26 def memo @memo end |
#period_range_end ⇒ String
TODO: Write general description for this method
66 67 68 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 66 def period_range_end @period_range_end end |
#period_range_start ⇒ String
TODO: Write general description for this method
62 63 64 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 62 def period_range_start @period_range_start end |
#product_handle ⇒ String
TODO: Write general description for this method
54 55 56 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 54 def product_handle @product_handle end |
#product_id ⇒ Integer
TODO: Write general description for this method
50 51 52 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 50 def product_id @product_id end |
#product_name ⇒ String
TODO: Write general description for this method
58 59 60 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 58 def product_name @product_name end |
#taxable_amount_in_cents ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 34 def taxable_amount_in_cents @taxable_amount_in_cents end |
#transaction_type ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 14 def transaction_type @transaction_type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 137 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. transaction_type = hash.key?('transaction_type') ? hash['transaction_type'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP amount_in_cents = hash.key?('amount_in_cents') ? hash['amount_in_cents'] : SKIP memo = hash.key?('memo') ? hash['memo'] : SKIP discount_amount_in_cents = hash.key?('discount_amount_in_cents') ? hash['discount_amount_in_cents'] : SKIP taxable_amount_in_cents = hash.key?('taxable_amount_in_cents') ? hash['taxable_amount_in_cents'] : SKIP component_id = hash.key?('component_id') ? hash['component_id'] : SKIP component_handle = hash.key?('component_handle') ? hash['component_handle'] : SKIP component_name = hash.key?('component_name') ? hash['component_name'] : SKIP product_id = hash.key?('product_id') ? hash['product_id'] : SKIP product_handle = hash.key?('product_handle') ? hash['product_handle'] : SKIP product_name = hash.key?('product_name') ? hash['product_name'] : SKIP period_range_start = hash.key?('period_range_start') ? hash['period_range_start'] : SKIP period_range_end = hash.key?('period_range_end') ? hash['period_range_end'] : SKIP # Create object from extracted values. BillingManifestItem.new(transaction_type, kind, amount_in_cents, memo, discount_amount_in_cents, taxable_amount_in_cents, component_id, component_handle, component_name, product_id, product_handle, product_name, period_range_start, period_range_end) end |
.names ⇒ Object
A mapping from model property names to API property names.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 69 def self.names @_hash = {} if @_hash.nil? @_hash['transaction_type'] = 'transaction_type' @_hash['kind'] = 'kind' @_hash['amount_in_cents'] = 'amount_in_cents' @_hash['memo'] = 'memo' @_hash['discount_amount_in_cents'] = 'discount_amount_in_cents' @_hash['taxable_amount_in_cents'] = 'taxable_amount_in_cents' @_hash['component_id'] = 'component_id' @_hash['component_handle'] = 'component_handle' @_hash['component_name'] = 'component_name' @_hash['product_id'] = 'product_id' @_hash['product_handle'] = 'product_handle' @_hash['product_name'] = 'product_name' @_hash['period_range_start'] = 'period_range_start' @_hash['period_range_end'] = 'period_range_end' @_hash end |
.nullables ⇒ Object
An array for nullable fields
109 110 111 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 109 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
# File 'lib/advanced_billing/models/billing_manifest_item.rb', line 89 def self.optionals %w[ transaction_type kind amount_in_cents memo discount_amount_in_cents taxable_amount_in_cents component_id component_handle component_name product_id product_handle product_name period_range_start period_range_end ] end |