Module: DataMapper::YS::Scraper

Defined in:
lib/dm-ys/scraper.rb

Defined Under Namespace

Modules: Utils Classes: Base, Composite, Page, TableNotFound

Class Method Summary collapse

Class Method Details

.load(model) ⇒ Object



24
25
26
27
28
# File 'lib/dm-ys/scraper.rb', line 24

def self.load(model)
  loader = lookup(model)
  loader.register_properties!
  return loader
end

.lookup(model) ⇒ Object



19
20
21
22
# File 'lib/dm-ys/scraper.rb', line 19

def self.lookup(model)
  scraper = paginate?(model) ? Composite : Page
  scraper.new(model)
end

.paginate?(model) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/dm-ys/scraper.rb', line 15

def self.paginate?(model)
  model.uri.to_s[-1] == ?*
end