Sha256: 92e096e1fe155e15564a1a6598bbdbfffe0ecfea85dd3f72bc51f24ec842430f

Contents?: true

Size: 660 Bytes

Versions: 1

Compression:

Stored size: 660 Bytes

Contents

['feed','station','entrance'].each do |file|
  require File.join(File.dirname(__FILE__), 'tfl_tube_stations', file)
end
require 'rubygems'
require 'net/http'
require 'hpricot'

module TflTubeStations
  
  @feed_url = nil # feed location for tfl data
  
  def self.get_stations
    return [] if @feed_url.nil?
    
    # get feed with the url
    feed = Feed.new(@feed_url)
    
    # parse and respond
    feed.parse
  end
  
  def self.feed_url=(feed_url)
    @feed_url = feed_url
  end
end

#TflTubeStations::feed_url = "http://feed/url"

#stations = TflTubeStations.get_stations

#stations.each do |station|
#  puts "#{station.name} #{station.address}"
#end

Version data entries

1 entries across 1 versions & 1 rubygems

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