Sha256: 20cafd481d473edc026d96dd39fc3a7b241fb0b6dfe37b8eaba87dcc2173ab66

Contents?: true

Size: 548 Bytes

Versions: 1

Compression:

Stored size: 548 Bytes

Contents

require 'wombat'
Dir[File.dirname(__FILE__) + "/pennride/*.rb"].each { |file| require file }

ROOT = 'http://pennrides.com'

class PennRide
  attr_accessor :routes

  # Returns array of instantiated Routes
  def initialize(root = ROOT)
    @root = root
    @routes = Wombat.crawl {
      base_url ROOT
      path '/simple/routes'
      routes "xpath=//li[@class='arrow']", :iterator do
        name "xpath=./a/text()"
        href "xpath=./a/@href"
      end
    }['routes'].map { |r| Route.new(r['name'], r['href']) }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pennride-0.1 lib/pennride.rb