Module: Sergio

Defined in:
lib/sergio.rb,
lib/sergio/version.rb,
lib/sergio/hash_methods.rb,
lib/sergio/sergio_config.rb,
lib/sergio/sergio_element.rb,
lib/sergio/sergio_parsed_document.rb

Defined Under Namespace

Modules: ClassMethods, HashMethods Classes: Config, Element, ParsedDocument

Constant Summary collapse

VERSION =
"0.0.3"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



9
10
11
12
# File 'lib/sergio.rb', line 9

def self.included(base)
  base.extend(ClassMethods)
  include(Sergio::HashMethods)
end

Instance Method Details

#parse(doc) ⇒ Object



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

def parse(doc)
  Nokogiri::XML::SAX::Parser.new(SergioSax.new(self)).parse(doc)
  sergio_parsed_document.parsed_hash
end

#sergio_parsed_documentObject



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

def sergio_parsed_document
  @sergio_parsed_document ||= Sergio::ParsedDocument.new
end