INITIALIZATION
# supported data types are: # :qb - Quickbooks # :qbpos - Quickbooks Point Of Sale
api = Quickbooks::API.instance(:qbpos)
# shorthand initialization api = Quickbooks::API
API INTROSPECTION
# returns all available wrapper classes api.qbxml_classes
# returns the top level wrapper class for the api api.container
# find specific qbxml class by name api.find(‘customer_mod_rq’)
# find all qbxml classes that contain a pattern api.grep(/_mod_rq/)
# returns a hash of all the data types for a wrapper class wrapper_class.template
# returns the full teplate for a wrapper class (SLOOOW for top level classes) wrapper_class.template(true)
# returns all the supported fields for the wrapper class wrapper_class.attribute_names
# returns the qbxml template used to generate the wrapper class wrapper_class.xml_template
QBXML TO RUBY
# wrap qbxml data in a qbxml object o = api.qbxml_to_obj(qbxml)
# convert qbxml object to hash o.inner_attributes
# same as above but includes the top level containers o.attributes
# retrieves attributes from nested objects o.attributes(true)
# directly convert raw qbxml to a hash h = api.qbxml_to_hash(qbxml)
# same as above but includes the top level containers h = api.qbxml_to_hash(qbxml, true)
RUBY TO QBXML
# convert a hash to a qbxml object (automagically creates the top level containers) o = api.hash_to_obj(data_hash)
# convert a qbxml object to raw qbxml o.to_qbxml.to_s
# convert a hash directly to raw qbxml qbxml = api.hash_to_qbxml(data_hash)