class Beaver::ItemizedReceipt
ItemizedReceipt
Model.
Attributes
amount[RW]
TODO: Write general description for this method @return [Float]
currency[RW]
TODO: Write general description for this method @return [CurrencyEnum]
description[RW]
TODO: Write general description for this method @return [String]
item_price[RW]
TODO: Write general description for this method @return [Integer]
project_name[RW]
TODO: Write general description for this method @return [String]
quantity[RW]
TODO: Write general description for this method @return [Float]
service_billing_method[RW]
TODO: Write general description for this method @return [ServiceBillingMethodEnum]
Public Class Methods
from_hash(hash)
click to toggle source
Creates an instance of the object from a hash.
# File lib/beaver/models/itemized_receipt.rb, line 67 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. amount = hash['amount'] description = hash['description'] item_price = hash['item_price'] quantity = hash['quantity'] currency = hash['currency'] project_name = hash['project_name'] service_billing_method = hash['service_billing_method'] # Create object from extracted values. ItemizedReceipt.new(amount, description, item_price, quantity, currency, project_name, service_billing_method) end
names()
click to toggle source
A mapping from model property names to API property names.
# File lib/beaver/models/itemized_receipt.rb, line 38 def self.names @_hash = {} if @_hash.nil? @_hash['amount'] = 'amount' @_hash['currency'] = 'currency' @_hash['description'] = 'description' @_hash['item_price'] = 'item_price' @_hash['project_name'] = 'project_name' @_hash['quantity'] = 'quantity' @_hash['service_billing_method'] = 'service_billing_method' @_hash end
new(amount = nil, description = nil, item_price = nil, quantity = nil, currency = nil, project_name = nil, service_billing_method = nil)
click to toggle source
# File lib/beaver/models/itemized_receipt.rb, line 50 def initialize(amount = nil, description = nil, item_price = nil, quantity = nil, currency = nil, project_name = nil, service_billing_method = nil) @amount = amount @currency = currency @description = description @item_price = item_price @project_name = project_name @quantity = quantity @service_billing_method = service_billing_method end