class NSConnector::Invoice

Invoice resource

Fields

SubLists

Public Instance Methods

to_pdf() click to toggle source

Convert ourself to PDF

Returns

A long string with the PDF data

# File lib/ns_connector/resources/invoice.rb, line 454
def to_pdf
        unless id then raise ::ArgumentError,
                'Could not find id for this Invoice, are you trying '\
                'to convert an invoice to PDF without creating it?'
        end

        encoded = NSConnector::Restlet.execute!(
                :action => 'invoice_pdf',
                :invoice_id => id
        ).first
        Base64::decode64(encoded)
end