Class: Html2rss::AutoSource::Channel
- Inherits:
-
Object
- Object
- Html2rss::AutoSource::Channel
- Defined in:
- lib/html2rss/auto_source/channel.rb
Overview
Extracts channel information from
-
the HTML document’s <head>.
-
the HTTP response
Instance Attribute Summary collapse
-
#articles ⇒ Object
writeonly
Sets the attribute articles.
-
#stylesheets ⇒ Object
readonly
Returns the value of attribute stylesheets.
Instance Method Summary collapse
- #description ⇒ Object
- #generator ⇒ Object
- #image ⇒ Object
-
#initialize(parsed_body, url:, headers:, articles: [], stylesheets: []) ⇒ Channel
constructor
A new instance of Channel.
- #language ⇒ Object
- #last_build_date ⇒ Object
- #title ⇒ Object
- #ttl ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(parsed_body, url:, headers:, articles: [], stylesheets: []) ⇒ Channel
Returns a new instance of Channel.
16 17 18 19 20 21 22 |
# File 'lib/html2rss/auto_source/channel.rb', line 16 def initialize(parsed_body, url:, headers:, articles: [], stylesheets: []) @parsed_body = parsed_body @url = url @headers = headers @articles = articles @stylesheets = stylesheets end |
Instance Attribute Details
#articles=(value) ⇒ Object (writeonly)
Sets the attribute articles
24 25 26 |
# File 'lib/html2rss/auto_source/channel.rb', line 24 def articles=(value) @articles = value end |
#stylesheets ⇒ Object (readonly)
Returns the value of attribute stylesheets.
25 26 27 |
# File 'lib/html2rss/auto_source/channel.rb', line 25 def stylesheets @stylesheets end |
Instance Method Details
#description ⇒ Object
30 |
# File 'lib/html2rss/auto_source/channel.rb', line 30 def description = extract_description |
#generator ⇒ Object
35 36 37 |
# File 'lib/html2rss/auto_source/channel.rb', line 35 def generator "html2rss V. #{::Html2rss::VERSION} (using auto_source scrapers: #{scraper_counts})" end |
#image ⇒ Object
31 |
# File 'lib/html2rss/auto_source/channel.rb', line 31 def image = extract_image |
#language ⇒ Object
29 |
# File 'lib/html2rss/auto_source/channel.rb', line 29 def language = extract_language |
#last_build_date ⇒ Object
33 |
# File 'lib/html2rss/auto_source/channel.rb', line 33 def last_build_date = headers['last-modified'] |
#title ⇒ Object
28 |
# File 'lib/html2rss/auto_source/channel.rb', line 28 def title = extract_title |
#ttl ⇒ Object
32 |
# File 'lib/html2rss/auto_source/channel.rb', line 32 def ttl = extract_ttl |
#url ⇒ Object
27 |
# File 'lib/html2rss/auto_source/channel.rb', line 27 def url = extract_url |