Class: Fortnox::API::Repository::Customer

Inherits:
Base
  • Object
show all
Defined in:
lib/fortnox/api/repositories/customer.rb

Constant Summary collapse

CONFIGURATION =
Fortnox::API::Repository::Base::Options.new(
  uri: '/customers/',
  json_collection_wrapper: 'Customers',
  json_entity_wrapper: 'Customer',
  unique_id: 'CustomerNumber',
  attribute_name_to_json_key_map: {
    vat_type: 'VATType',
    vat_number: 'VATNumber',
    email_invoice_bcc: 'EmailInvoiceBCC',
    email_invoice_cc: 'EmailInvoiceCC',
    email_offer_bcc: 'EmailOfferBCC',
    email_offer_cc: 'EmailOfferCC',
    email_order_bcc: 'EmailOrderBCC',
    email_order_cc: 'EmailOrderCC',
    show_price_vat_included: 'ShowPriceVATIncluded',
  },
  keys_filtered_on_save: [
    :url,
  ]
)
MODEL =
Fortnox::API::Model::Customer

Constants inherited from Base

Base::DEFAULT_HEADERS, Base::HTTP_METHODS

Instance Attribute Summary

Attributes inherited from Base

#headers

Instance Method Summary collapse

Methods included from Savers

#save

Methods included from Loaders

#all, #escape, #find, #find_one_by, #only, #to_query

Methods included from ClassMethods

#get_access_token, #set_headers

Constructor Details

#initializeCustomer

Returns a new instance of Customer.



31
32
33
# File 'lib/fortnox/api/repositories/customer.rb', line 31

def initialize
  super( CONFIGURATION )
end