Sha256: 860957d703110ed63f3cf2cf67241b9dd70f69098a6c75a1230d8cbad6c49d37

Contents?: true

Size: 1.81 KB

Versions: 7

Compression:

Stored size: 1.81 KB

Contents

INITIALIZATION
------------------------------------------------------------------------------

# supported data types are:
# :qb    - Quickbooks
# :qbpos - Quickbooks Point Of Sale

api = Quickbooks::API.instance(:qbpos)

# shorthand initialization
api = Quickbooks::API[:qbpos]


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)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
quickbooks_api-0.1.6 README
quickbooks_api-0.1.5 README
quickbooks_api-0.1.4 README
quickbooks_api-0.1.3 README
quickbooks_api-0.1.2 README
quickbooks_api-0.1.1 README
quickbooks_api-0.1.0 README