Sha256: 35f9e820aa9c76216c023c8718c87d59accefc0fe551545a957a04fea26cb614

Contents?: true

Size: 862 Bytes

Versions: 2

Compression:

Stored size: 862 Bytes

Contents

module TflTubeStations
  class Entrance
    
    attr_accessor :doc, :name, :entry_to_bookinghall
    
    def initialize(doc)
      @doc = doc
      @name = @doc.search("/name").inner_text
      @entry_to_bookinghall = @doc.search("/entrancetobookinghall").inner_text.strip
    end
    
    
    def booking_hall_to_platforms
      @booking_hall_to_platforms = []
      @doc.search("/bookingHallToPlatform/path").each do |r|
        @booking_hall_to_platforms << {r.at("/heading").inner_text => r.at("/pathDescription").inner_text}
      end
      @booking_hall_to_platforms
    end
    
    def platform_to_trains
      @platform_to_trains = []
      @doc.search("/platformToTrain").each do |r|
        @platform_to_trains << {r.at("/trainName").inner_text => r.at("/platformToTrainSteps").inner_text}
      end
      @platform_to_trains
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kalv-tfl-tube-stations-0.1.0 lib/tfl_tube_stations/entrance.rb
kalv-tfl-tube-stations-0.1.1 lib/tfl_tube_stations/entrance.rb