Class: String
- Inherits:
-
Object
- Object
- String
- Includes:
- CrawlerSample
- Defined in:
- lib/crawler_sample/string.rb
Constant Summary
Constants included from CrawlerSample
Instance Attribute Summary
Attributes included from CrawlerSample
#crawl_stop_count, #deep_flg, #delay, #exclude_urls, #stop_flg, #target_urls, #top_url
Instance Method Summary collapse
Methods included from CrawlerSample
#crawl, #crawl_delay, #crawl_delay=, #crawl_from_url, #crawl_is_force_stop, #scrape
Instance Method Details
#crawler(&block) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/crawler_sample/string.rb', line 5 def crawler(&block) url=Url.new(:value=>self) raise "URL is invalid" unless url.valid? crawl(url.value) do|contents| block.call(contents) if block_given? end end |