Class: DownloadTV::LinkGrabber
- Inherits:
-
Object
- Object
- DownloadTV::LinkGrabber
- Defined in:
- lib/download_tv/linkgrabber.rb
Overview
Interface for the grabbers
Direct Known Subclasses
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #get_links(_show) ⇒ Object
-
#initialize(url) ⇒ LinkGrabber
constructor
A new instance of LinkGrabber.
- #online? ⇒ Boolean
Constructor Details
#initialize(url) ⇒ LinkGrabber
Returns a new instance of LinkGrabber.
9 10 11 |
# File 'lib/download_tv/linkgrabber.rb', line 9 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/download_tv/linkgrabber.rb', line 7 def url @url end |
Instance Method Details
#get_links(_show) ⇒ Object
25 26 27 |
# File 'lib/download_tv/linkgrabber.rb', line 25 def get_links(_show) raise NotImplementedError end |
#online? ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/download_tv/linkgrabber.rb', line 13 def online? url = if @url.include? '%s' format(@url, 'test') else @url end agent.head(url) true rescue StandardError false end |