Module: Badgerhash

Defined in:
lib/badgerhash.rb,
lib/badgerhash/version.rb,
lib/badgerhash/xml_stream.rb,
lib/badgerhash/parsers/rexml.rb,
lib/badgerhash/handlers/sax_handler.rb

Overview

Convert XML to Ruby Hash using Badgerfish convention: badgerfish.ning.com/

Defined Under Namespace

Modules: Handlers, Parsers Classes: XmlStream

Constant Summary collapse

DEFAULT_SAX_PARSER =

Class of the default sax parser implementation

Parsers::REXML::SaxDocument
VERSION =

The String containing the current version of the library.

"0.0.1"

Class Method Summary collapse

Class Method Details

.sax_parserClass

The current sax parser implementation

Examples:

Badgerhash.sax_parser => Parsers::REXML::SaxDocument

Returns:

  • (Class)

    the current sax parser implementation



28
29
30
# File 'lib/badgerhash.rb', line 28

def self.sax_parser
  @sax_parser || DEFAULT_SAX_PARSER
end

.sax_parser=(parser) ⇒ Class

Set the sax parser for the module

Examples:

Badgerhash.sax_parser = MyFastParser => MyFastParser

Parameters:

  • parser (Class)

    a parser that supports the required interface

Returns:

  • (Class)

    the new parser class

See Also:



19
20
21
# File 'lib/badgerhash.rb', line 19

def self.sax_parser=(parser)
  @sax_parser = parser
end