Class: VORuby::ActiveVotable::LibXmlSaxParserWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/voruby/active_votable/active_votable.rb

Direct Known Subclasses

VOTableExtractor

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ LibXmlSaxParserWrapper

Returns a new instance of LibXmlSaxParserWrapper.



11
12
13
14
# File 'lib/voruby/active_votable/active_votable.rb', line 11

def initialize(file)
  @parser = XML::SaxParser.new
  self.filename = file
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



25
26
27
# File 'lib/voruby/active_votable/active_votable.rb', line 25

def method_missing(symbol, *args)
  @parser.send(symbol, *args)
end

Instance Attribute Details

#filenameObject

Returns the value of attribute filename.



9
10
11
# File 'lib/voruby/active_votable/active_votable.rb', line 9

def filename
  @filename
end

Instance Method Details

#add_listener(event, &proc) ⇒ Object



21
22
23
# File 'lib/voruby/active_votable/active_votable.rb', line 21

def add_listener(event, &proc)
  @parser.send(event, &proc)
end