This class stores information about a feed item's file enclosures.
Returns true if this enclosure contains audio content
# File lib/feed_tools/feed_structures.rb, line 215 def audio? unless self.type.nil? return true if (self.type =~ /^audio/) != nil end # TODO: create a more complete list # ================================= audio_extensions = ['mp3', 'm4a', 'm4p', 'wav', 'ogg', 'wma'] audio_extensions.each do |extension| if (url =~ /#{extension}$/) != nil return true end end return false end
Sets the explicit attribute on the enclosure
# File lib/feed_tools/feed_structures.rb, line 194 def explicit=(new_explicit) @explicit = new_explicit end
Returns true if the enclosure contains explicit material
# File lib/feed_tools/feed_structures.rb, line 189 def explicit? return @explicit end
Determines if the object is a sample, or the full version of the object, or if it is a stream. Possible values are 'sample', 'full', 'nonstop'.
# File lib/feed_tools/feed_structures.rb, line 201 def expression return @expression end
Sets the expression attribute on the enclosure. Allowed values are 'sample', 'full', 'nonstop'.
# File lib/feed_tools/feed_structures.rb, line 207 def expression=(new_expression) unless ['sample', 'full', 'nonstop'].include? new_expression.downcase return @expression end @expression = new_expression.downcase end
Sets whether this is the default enclosure for the media group
# File lib/feed_tools/feed_structures.rb, line 184 def is_default=(new_is_default) @is_default = new_is_default end
Returns true if this is the default enclosure
# File lib/feed_tools/feed_structures.rb, line 179 def is_default? return @is_default end
Returns true if this enclosure contains video content
# File lib/feed_tools/feed_structures.rb, line 231 def video? unless self.type.nil? return true if (self.type =~ /^video/) != nil return true if self.type == "image/mov" end # TODO: create a more complete list # ================================= video_extensions = ['mov', 'mp4', 'avi', 'wmv', 'asf'] video_extensions.each do |extension| if (url =~ /#{extension}$/) != nil return true end end return false end
Generated with the Darkfish Rdoc Generator 2.