class AMarmita::Scrapper

Attributes

attributes[R]
css_parser[R]

Public Class Methods

new(css_parser) click to toggle source
# File lib/a_marmita/scrapper.rb, line 7
def initialize(css_parser)
  @attributes = { id: 0 }

  @css_parser = css_parser
end

Public Instance Methods

run(options = {}) click to toggle source
# File lib/a_marmita/scrapper.rb, line 27
def run(options = {})
  raise '#run must be implemented'
end
scrap(options = {}) click to toggle source
# File lib/a_marmita/scrapper.rb, line 21
def scrap(options = {})
  run(options)
  
  valid? ? @attributes : nil
end
to_hash() click to toggle source
# File lib/a_marmita/scrapper.rb, line 17
def to_hash
  @attributes
end
valid?() click to toggle source
# File lib/a_marmita/scrapper.rb, line 13
def valid?
  @attributes[:id] > 0
end