Class: Syndication::RSS::Enclosure
- Defined in:
- lib/syndication/rss.rb
Overview
Represents a multimedia enclosure in an RSS item. Typically found as Syndication::Item#enclosure
Instance Attribute Summary collapse
-
#length ⇒ Object
The length of the file, in bytes.
-
#type ⇒ Object
The MIME type of the file.
-
#url ⇒ Object
The URL to the multimedia file.
Instance Method Summary collapse
-
#initialize(parent, tag, attrs = nil) ⇒ Enclosure
constructor
A new instance of Enclosure.
Methods inherited from Container
#parse_date, #store, #store_category, #strip, #tag2method, #tag_end, #tag_start
Constructor Details
#initialize(parent, tag, attrs = nil) ⇒ Enclosure
Returns a new instance of Enclosure.
257 258 259 260 261 262 263 264 265 |
# File 'lib/syndication/rss.rb', line 257 def initialize(parent, tag, attrs = nil) @tag = tag @parent = parent if attrs attrs.each_pair {|key, value| self.store(key, value) } end end |
Instance Attribute Details
#length ⇒ Object
The length of the file, in bytes.
250 251 252 |
# File 'lib/syndication/rss.rb', line 250 def length @length end |
#type ⇒ Object
The MIME type of the file.
248 249 250 |
# File 'lib/syndication/rss.rb', line 248 def type @type end |
#url ⇒ Object
The URL to the multimedia file.
246 247 248 |
# File 'lib/syndication/rss.rb', line 246 def url @url end |