Class: FeedParser::Nokogiri::StrictFeedParser

Inherits:
Object
  • Object
show all
Defined in:
lib/rfeedparser/nokogiri_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#handlerObject (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