Class: Pennride

Inherits:
Object
  • Object
show all
Defined in:
lib/pennride.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root = ROOT) ⇒ Pennride

Returns array of instantiated Routes



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/pennride.rb', line 10

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

Instance Attribute Details

#routesObject

Returns the value of attribute routes.



7
8
9
# File 'lib/pennride.rb', line 7

def routes
  @routes
end