Class: Scraptacular::URL
- Inherits:
-
Object
- Object
- Scraptacular::URL
- Defined in:
- lib/scraptacular/url.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#scraper ⇒ Object
readonly
Returns the value of attribute scraper.
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ URL
constructor
A new instance of URL.
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, = {}) @path = path if [:with] unless @scraper = Scraptacular.world.scrapers[[:with]] raise ArgumentError, "The supplied scraper :#{[:with]} does not exist" end end end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/scraptacular/url.rb', line 3 def path @path end |
#scraper ⇒ Object (readonly)
Returns the value of attribute scraper.
3 4 5 |
# File 'lib/scraptacular/url.rb', line 3 def scraper @scraper end |