Module: LoyalSpider::EntityListerAble::ClassMethods

Defined in:
lib/loyal_spider/ables/entity_lister_able.rb

Instance Method Summary collapse

Instance Method Details

#config_loyal_spider_entity_lister(options = {}) ⇒ Object

options:

- url_format
- url_format_first
- url_format_options


21
22
23
24
25
26
27
# File 'lib/loyal_spider/ables/entity_lister_able.rb', line 21

def config_loyal_spider_entity_lister options={}
  @entity_lister_options ||= options

  self.config_loyal_spider_default_fetch_options(
    self.entity_lister_options.delete(:fetch_options) || {}
  )
end

#entity_lister_optionsObject



35
36
37
# File 'lib/loyal_spider/ables/entity_lister_able.rb', line 35

def entity_lister_options
  @entity_lister_options ||= {}
end

#paged_fetch(page, options = {}, &block) ⇒ Object

按页抓取



40
41
42
43
44
# File 'lib/loyal_spider/ables/entity_lister_able.rb', line 40

def paged_fetch page, options={}, &block
  lister = self.new
  lister.current_page = page
  lister.fetch options, &block
end