Class: Nzb::Parser::Callbacks
- Inherits:
-
Object
- Object
- Nzb::Parser::Callbacks
- Includes:
- LibXML::XML::SaxParser::Callbacks
- Defined in:
- lib/nzb/parser.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Instance Method Summary collapse
-
#initialize ⇒ Callbacks
constructor
A new instance of Callbacks.
- #on_characters(text) ⇒ Object
- #on_start_element(name, attrs) ⇒ Object
Constructor Details
#initialize ⇒ Callbacks
Returns a new instance of Callbacks.
21 22 23 |
# File 'lib/nzb/parser.rb', line 21 def initialize @files = [] end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
19 20 21 |
# File 'lib/nzb/parser.rb', line 19 def files @files end |
Instance Method Details
#on_characters(text) ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/nzb/parser.rb', line 36 def on_characters(text) if @segment @segment.msgid = text.strip @segment = nil elsif @group @files.last.add_group(text.strip) @group = nil end end |