Class: LedgerSync::Ledgers::QuickBooksOnline::Expense

Inherits:
Resource show all
Defined in:
lib/ledger_sync/ledgers/quickbooks_online/expense/searcher.rb,
lib/ledger_sync/ledgers/quickbooks_online/resources/expense.rb,
lib/ledger_sync/ledgers/quickbooks_online/expense/serializer.rb,
lib/ledger_sync/ledgers/quickbooks_online/expense/deserializer.rb,
lib/ledger_sync/ledgers/quickbooks_online/expense/operations/find.rb,
lib/ledger_sync/ledgers/quickbooks_online/expense/operations/create.rb,
lib/ledger_sync/ledgers/quickbooks_online/expense/operations/update.rb

Defined Under Namespace

Modules: Operations Classes: Deserializer, Searcher, Serializer

Constant Summary collapse

PAYMENT_TYPES =
BillPayment::PAYMENT_TYPES

Constants inherited from Resource

Resource::PRIMITIVES

Instance Method Summary collapse

Methods inherited from Resource

#==, #assign_attribute, #assign_attributes, #changed?, #changes, #class_from_resource_type, inherited, operations, resource_module_str, resource_type, serialize_attribute?, #to_h

Methods included from Mixins::InferClientMixin

included

Methods included from Util::Mixins::DupableMixin

#dup

Methods included from ResourceAttribute::Reference::Many::Mixin

included

Methods included from ResourceAttribute::Reference::One::Mixin

included

Methods included from ResourceAttribute::Mixin

#assign_attribute, #assign_attributes, included, #initialize, #resource_attributes, #save, #serialize_attributes

Methods included from Validatable

#valid?, #validate, #validate_or_fail

Instance Method Details

#amountObject



30
31
32
# File 'lib/ledger_sync/ledgers/quickbooks_online/resources/expense.rb', line 30

def amount
  line_items.map(&:amount).sum
end

#nameObject



34
35
36
# File 'lib/ledger_sync/ledgers/quickbooks_online/resources/expense.rb', line 34

def name
  "Purchase: #{amount} #{currency.try(:symbol)}"
end