Class: Moneybird::Resource::ExternalSalesInvoice

Inherits:
Object
  • Object
show all
Extended by:
ClassMethods
Includes:
Moneybird::Resource
Defined in:
lib/moneybird/resource/external_sales_invoice.rb

Instance Attribute Summary

Attributes included from ClassMethods

#attributes, #logger, #nillable_attributes

Attributes included from Moneybird::Resource

#client, #errors

Instance Method Summary collapse

Methods included from ClassMethods

build, has_attributes, has_boolean_attributes, has_datetime_attributes, has_integer_attributes, has_nillable_attributes, resource

Methods included from Moneybird::Resource

#attributes, #attributes=, #custom_fields=, #initialize, #link_booking, #path, #persisted?, #to_json

Instance Method Details

#contact=(attributes) ⇒ Object



44
45
46
# File 'lib/moneybird/resource/external_sales_invoice.rb', line 44

def contact=(attributes)
  @contact = Moneybird::Resource::Contact.build(attributes)
end

#details=(line_items) ⇒ Object



53
54
55
# File 'lib/moneybird/resource/external_sales_invoice.rb', line 53

def details=(line_items)
  @details = line_items.map{ |line_item| Moneybird::Resource::Invoice::Details.build(line_item) }
end

#events=(events) ⇒ Object



57
58
59
# File 'lib/moneybird/resource/external_sales_invoice.rb', line 57

def events=(events)
  @events = events.map{ |event| Moneybird::Resource::Generic::Event.build(event) }
end

#notes=(notes) ⇒ Object



40
41
42
# File 'lib/moneybird/resource/external_sales_invoice.rb', line 40

def notes=(notes)
  @notes = notes.map{ |note| Moneybird::Resource::Generic::Note.build(note) }
end

#payments=(payments) ⇒ Object



48
49
50
51
# File 'lib/moneybird/resource/external_sales_invoice.rb', line 48

def payments=(payments)
  payment_data = payments.map{ |payment| Moneybird::Resource::Invoice::Payment.build(payment) }
  @payments = Moneybird::Service::Payment.new(client, administration_id, preloaded_data: payment_data, invoice_id: id)
end