Method: ProcessOut::InvoiceDetail#prefill
- Defined in:
- lib/processout/invoice_detail.rb
#prefill(data) ⇒ Object
Prefills the object with the data passed as parameters Params:
data-
Hashof data
209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
# File 'lib/processout/invoice_detail.rb', line 209 def prefill(data) if data.nil? return self end self.id = data.fetch(:id, self.id) self.name = data.fetch(:name, self.name) self.type = data.fetch(:type, self.type) self.amount = data.fetch(:amount, self.amount) self.quantity = data.fetch(:quantity, self.quantity) self. = data.fetch(:metadata, self.) self.reference = data.fetch(:reference, self.reference) self.description = data.fetch(:description, self.description) self.brand = data.fetch(:brand, self.brand) self.model = data.fetch(:model, self.model) self.discount_amount = data.fetch(:discount_amount, self.discount_amount) self.condition = data.fetch(:condition, self.condition) self.marketplace_merchant = data.fetch(:marketplace_merchant, self.marketplace_merchant) self.marketplace_merchant_is_business = data.fetch(:marketplace_merchant_is_business, self.marketplace_merchant_is_business) self.marketplace_merchant_created_at = data.fetch(:marketplace_merchant_created_at, self.marketplace_merchant_created_at) self.category = data.fetch(:category, self.category) self end |