Class: NationalRailWrapper::Feeds::KnowledgeBase::Parsers::Incidents
- Inherits:
-
Object
- Object
- NationalRailWrapper::Feeds::KnowledgeBase::Parsers::Incidents
- Defined in:
- lib/national_rail_wrapper/feeds/knowledge_base/parsers/incidents.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Incidents
constructor
A new instance of Incidents.
- #to_json ⇒ Object
Constructor Details
#initialize(data) ⇒ Incidents
Returns a new instance of Incidents.
6 7 8 |
# File 'lib/national_rail_wrapper/feeds/knowledge_base/parsers/incidents.rb', line 6 def initialize(data) @data = data end |
Instance Method Details
#to_json ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/national_rail_wrapper/feeds/knowledge_base/parsers/incidents.rb', line 10 def to_json = Nokogiri::XML::ParseOptions.new.nonet.noent.noblanks doc = Nokogiri::XML.parse(@data, nil, nil, ) doc.xpath('/xmlns:NSI/xmlns:TOC').map do |toc_node| { } end end |