Class: NationalRailWrapper::Feeds::KnowledgeBase::Parsers::Incidents

Inherits:
Object
  • Object
show all
Defined in:
lib/national_rail_wrapper/feeds/knowledge_base/parsers/incidents.rb

Instance Method Summary collapse

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_jsonObject



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
  options = Nokogiri::XML::ParseOptions.new.nonet.noent.noblanks
  doc = Nokogiri::XML.parse(@data, nil, nil, options)
  doc.xpath('/xmlns:NSI/xmlns:TOC').map do |toc_node|
    {

    }
  end
end