Class: RSSFeed::RSSImage
Instance Method Summary collapse
-
#description ⇒ Object
Description (optional).
-
#height ⇒ Object
Height (optional).
-
#initialize(node) ⇒ RSSImage
constructor
Initializes the image element.
-
#link ⇒ Object
Link (required).
-
#title ⇒ Object
Title (required).
-
#url ⇒ Object
URL (required).
-
#width ⇒ Object
Width (optional).
Constructor Details
#initialize(node) ⇒ RSSImage
Initializes the image element.
4 5 6 |
# File 'lib/rss_feed/rss_image.rb', line 4 def initialize(node) @node = node end |
Instance Method Details
#description ⇒ Object
Description (optional)
34 35 36 |
# File 'lib/rss_feed/rss_image.rb', line 34 def description @node.at_xpath("description").try(:content) end |
#height ⇒ Object
Height (optional)
29 30 31 |
# File 'lib/rss_feed/rss_image.rb', line 29 def height @node.at_xpath("height").try(:content).to_i end |
#link ⇒ Object
Link (required)
19 20 21 |
# File 'lib/rss_feed/rss_image.rb', line 19 def link @node.at_xpath("link").content end |
#title ⇒ Object
Title (required)
14 15 16 |
# File 'lib/rss_feed/rss_image.rb', line 14 def title @node.at_xpath("title").content end |
#url ⇒ Object
URL (required)
9 10 11 |
# File 'lib/rss_feed/rss_image.rb', line 9 def url @node.at_xpath("url").content end |
#width ⇒ Object
Width (optional)
24 25 26 |
# File 'lib/rss_feed/rss_image.rb', line 24 def width @node.at_xpath("width").try(:content).to_i end |