Class: Html2rss::RssBuilder::Stylesheet
- Inherits:
-
Object
- Object
- Html2rss::RssBuilder::Stylesheet
- Defined in:
- lib/html2rss/rss_builder/stylesheet.rb
Overview
Represents a stylesheet.
Constant Summary collapse
- TYPES =
['text/css', 'text/xsl'].freeze
Instance Attribute Summary collapse
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#media ⇒ Object
readonly
Returns the value of attribute media.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.add(maker, stylesheets) ⇒ nil
Adds the stylesheet XML tags to the RSS.
Instance Method Summary collapse
-
#initialize(href:, type:, media: 'all') ⇒ Stylesheet
constructor
A new instance of Stylesheet.
Constructor Details
#initialize(href:, type:, media: 'all') ⇒ Stylesheet
Returns a new instance of Stylesheet.
40 41 42 43 44 45 46 47 48 |
# File 'lib/html2rss/rss_builder/stylesheet.rb', line 40 def initialize(href:, type:, media: 'all') raise ArgumentError, 'stylesheet.href must be a String' unless href.is_a?(String) raise ArgumentError, 'stylesheet.type invalid' unless TYPES.include?(type) raise ArgumentError, 'stylesheet.media must be a String' unless media.is_a?(String) @href = href @type = type @media = media end |
Instance Attribute Details
#href ⇒ Object (readonly)
Returns the value of attribute href.
49 50 51 |
# File 'lib/html2rss/rss_builder/stylesheet.rb', line 49 def href @href end |
#media ⇒ Object (readonly)
Returns the value of attribute media.
49 50 51 |
# File 'lib/html2rss/rss_builder/stylesheet.rb', line 49 def media @media end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
49 50 51 |
# File 'lib/html2rss/rss_builder/stylesheet.rb', line 49 def type @type end |
Class Method Details
.add(maker, stylesheets) ⇒ nil
Adds the stylesheet XML tags to the RSS.
15 16 17 18 19 |
# File 'lib/html2rss/rss_builder/stylesheet.rb', line 15 def add(maker, stylesheets) stylesheets.each do |stylesheet| add_stylesheet(maker, stylesheet) end end |