Class: Quickbooks::QbxmlParser

Inherits:
Object
  • Object
show all
Includes:
Support, Support::API, Support::QBXML
Defined in:
lib/quickbooks/qbxml_parser.rb

Direct Known Subclasses

DtdParser

Constant Summary

Constants included from Support::QBXML

Support::QBXML::COMMENT_END, Support::QBXML::COMMENT_MATCHER, Support::QBXML::COMMENT_START, Support::QBXML::XML_COMMENT, Support::QBXML::XML_DOCUMENT, Support::QBXML::XML_ELEMENT, Support::QBXML::XML_NODE, Support::QBXML::XML_NODE_SET, Support::QBXML::XML_TEXT

Constants included from Support::API

Support::API::API_ROOT, Support::API::DEFAULT_LOG_LEVEL, Support::API::RUBY_SCHEMA_PATH, Support::API::SCHEMA_MAP, Support::API::XML_SCHEMA_PATH

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::QBXML

#cleanup_qbxml, #is_leaf_node?, #qbxml_class_defined?, #set_required_attributes

Methods included from Support

#inflector, #log, #simple_class_name, #to_attribute_name

Constructor Details

#initialize(schema_type) ⇒ QbxmlParser



10
11
12
# File 'lib/quickbooks/qbxml_parser.rb', line 10

def initialize(schema_type)
  @schema_type = schema_type
end

Instance Attribute Details

#schema_typeObject

Returns the value of attribute schema_type.



8
9
10
# File 'lib/quickbooks/qbxml_parser.rb', line 8

def schema_type
  @schema_type
end

Instance Method Details

#parse(qbxml) ⇒ Object



18
19
20
21
# File 'lib/quickbooks/qbxml_parser.rb', line 18

def parse(qbxml)
  xml_doc = Nokogiri::XML(qbxml)
  process_xml_obj(xml_doc, nil)
end

#parse_file(qbxml_file) ⇒ Object



14
15
16
# File 'lib/quickbooks/qbxml_parser.rb', line 14

def parse_file(qbxml_file)
  parse(qbxml_file.read)
end