Class: Parklife::Crawler
- Inherits:
-
Object
- Object
- Parklife::Crawler
- Defined in:
- lib/parklife/crawler.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#route_set ⇒ Object
readonly
Returns the value of attribute route_set.
Instance Method Summary collapse
- #get(path) ⇒ Object
-
#initialize(config, route_set) ⇒ Crawler
constructor
A new instance of Crawler.
- #start ⇒ Object
Constructor Details
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
10 11 12 |
# File 'lib/parklife/crawler.rb', line 10 def browser @browser end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/parklife/crawler.rb', line 10 def config @config end |
#route_set ⇒ Object (readonly)
Returns the value of attribute route_set.
10 11 12 |
# File 'lib/parklife/crawler.rb', line 10 def route_set @route_set end |
Instance Method Details
#get(path) ⇒ Object
18 19 20 |
# File 'lib/parklife/crawler.rb', line 18 def get(path) browser.get(path) end |
#start ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/parklife/crawler.rb', line 22 def start @routes = route_set.to_a @visited = Set.new while (route = @routes.shift) processed = process_route(route) config.reporter.print('.') if processed end config.reporter.puts end |