Class: FeedParser::Nokogiri::StrictFeedParser
- Inherits:
-
Object
- Object
- FeedParser::Nokogiri::StrictFeedParser
- Defined in:
- lib/rfeedparser/nokogiri_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.
11 12 13 |
# File 'lib/rfeedparser/nokogiri_parser.rb', line 11 def initialize(baseuri, baselang) @handler = StrictFeedParserHandler.new(baseuri, baselang, 'utf-8') end |
Instance Attribute Details
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
10 11 12 |
# File 'lib/rfeedparser/nokogiri_parser.rb', line 10 def handler @handler end |
Instance Method Details
#parse(data) ⇒ Object
15 16 17 18 19 |
# File 'lib/rfeedparser/nokogiri_parser.rb', line 15 def parse(data) saxparser = ::Nokogiri::XML::SAX::Parser.new(@handler) saxparser.parse data end |