Class: Pennride
- Inherits:
-
Object
- Object
- Pennride
- Defined in:
- lib/pennride.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
Returns the value of attribute routes.
Instance Method Summary collapse
-
#initialize(root = ROOT) ⇒ Pennride
constructor
Returns array of instantiated Routes.
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
#routes ⇒ Object
Returns the value of attribute routes.
7 8 9 |
# File 'lib/pennride.rb', line 7 def routes @routes end |