Class: Syndication::RSS::Enclosure

Inherits:
Container
  • Object
show all
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

Instance Method Summary collapse

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

#lengthObject

The length of the file, in bytes.



250
251
252
# File 'lib/syndication/rss.rb', line 250

def length
  @length
end

#typeObject

The MIME type of the file.



248
249
250
# File 'lib/syndication/rss.rb', line 248

def type
  @type
end

#urlObject

The URL to the multimedia file.



246
247
248
# File 'lib/syndication/rss.rb', line 246

def url
  @url
end