Class: Scraptacular::URL

Inherits:
Object
  • Object
show all
Defined in:
lib/scraptacular/url.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ URL

Returns a new instance of URL.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/scraptacular/url.rb', line 5

def initialize(path, options = {})
  @path = path

  if options[:with]
    unless @scraper = Scraptacular.world.scrapers[options[:with]]
      raise ArgumentError, "The supplied scraper :#{options[:with]} does not exist"
    end

  end

end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/scraptacular/url.rb', line 3

def path
  @path
end

#scraperObject (readonly)

Returns the value of attribute scraper.



3
4
5
# File 'lib/scraptacular/url.rb', line 3

def scraper
  @scraper
end