Class: FeedParser::LibXML::StrictFeedParser
- Inherits:
-
Object
- Object
- FeedParser::LibXML::StrictFeedParser
- Defined in:
- lib/rfeedparser/libxml_parser.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
Instance Method Summary collapse
-
#initialize(baseuri, baselang) ⇒ StrictFeedParser
constructor
A new instance of StrictFeedParser.
- #parse(data) ⇒ Object
Constructor Details
#initialize(baseuri, baselang) ⇒ StrictFeedParser
Returns a new instance of StrictFeedParser.
9 10 11 |
# File 'lib/rfeedparser/libxml_parser.rb', line 9 def initialize(baseuri, baselang) @handler = StrictFeedParserHandler.new(baseuri, baselang, 'utf-8') end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
7 8 9 |
# File 'lib/rfeedparser/libxml_parser.rb', line 7 def handler @handler end |
Instance Method Details
#parse(data) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/rfeedparser/libxml_parser.rb', line 13 def parse(data) saxparser = ::LibXML::XML::SaxParser.new saxparser.callbacks = @handler saxparser.string = data saxparser.parse end |