Class: RSSFeed::RSSImage

Inherits:
Object show all
Defined in:
lib/rss_feed/rss_image.rb

Instance Method Summary collapse

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

#descriptionObject

Description (optional)



34
35
36
# File 'lib/rss_feed/rss_image.rb', line 34

def description
  @node.at_xpath("description").try(:content)
end

#heightObject

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 (required)



19
20
21
# File 'lib/rss_feed/rss_image.rb', line 19

def link
  @node.at_xpath("link").content
end

#titleObject

Title (required)



14
15
16
# File 'lib/rss_feed/rss_image.rb', line 14

def title
  @node.at_xpath("title").content
end

#urlObject

URL (required)



9
10
11
# File 'lib/rss_feed/rss_image.rb', line 9

def url
  @node.at_xpath("url").content
end

#widthObject

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