Module: Spidr::Actions
- Defined in:
- lib/spidr/actions/actions.rb,
lib/spidr/actions/exceptions/paused.rb,
lib/spidr/actions/exceptions/action.rb,
lib/spidr/actions/exceptions/skip_page.rb,
lib/spidr/actions/exceptions/skip_link.rb
Defined Under Namespace
Classes: Action, Paused, SkipLink, SkipPage
Instance Method Summary
- - (Object) continue!(&block) {|page| ... } Continue spidering.
- - (Actions) initialize(options = {}) A new instance of Actions.
- - (Object) pause! Pauses the agent, causing spidering to temporarily stop.
- - (Object) pause=(state) Sets the pause state of the agent.
- - (Boolean) paused? Determines whether the agent is paused.
- - (Object) skip_link! Causes the agent to skip the link being enqueued.
- - (Object) skip_page! Causes the agent to skip the page being visited.
Instance Method Details
- (Object) continue!(&block) {|page| ... }
Continue spidering.
22 23 24 25 |
# File 'lib/spidr/actions/actions.rb', line 22 def continue!(&block) @paused = false return run(&block) end |
- (Actions) initialize(options = {})
A new instance of Actions
7 8 9 10 11 |
# File 'lib/spidr/actions/actions.rb', line 7 def initialize(={}) @paused = false super() end |
- (Object) pause!
Pauses the agent, causing spidering to temporarily stop.
43 44 45 46 |
# File 'lib/spidr/actions/actions.rb', line 43 def pause! @paused = true raise(Paused) end |
- (Object) pause=(state)
Sets the pause state of the agent.
33 34 35 |
# File 'lib/spidr/actions/actions.rb', line 33 def pause=(state) @paused = state end |
- (Boolean) paused?
Determines whether the agent is paused.
54 55 56 |
# File 'lib/spidr/actions/actions.rb', line 54 def paused? @paused == true end |
- (Object) skip_link!
Causes the agent to skip the link being enqueued.
65 66 67 |
# File 'lib/spidr/actions/actions.rb', line 65 def skip_link! raise(SkipLink) end |
- (Object) skip_page!
Causes the agent to skip the page being visited.
75 76 77 |
# File 'lib/spidr/actions/actions.rb', line 75 def skip_page! raise(SkipPage) end |