Class: FeedzirraPodcast::Parser::RSS2

Inherits:
Object
  • Object
show all
Includes:
Feedzirra::FeedUtilities, SAXMachine
Defined in:
lib/feedzirra-podcast/parser/rss2.rb

Direct Known Subclasses

Podcast

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#feed_urlObject

Returns the value of attribute feed_url.



41
42
43
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 41

def feed_url
  @feed_url
end

Class Method Details

.able_to_parse?(xml) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


43
44
45
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 43

def self.able_to_parse?(xml) #:nodoc:
  (/\<rss|\<rdf/ =~ xml)
end

Instance Method Details

#feedburner?Boolean

Returns:

  • (Boolean)


73
74
75
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 73

def feedburner?
  !!feedburner_info_xmlns || !!feedburner_info_uri
end

#imageObject



47
48
49
50
51
52
53
54
55
56
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 47

def image
  _url = image_object ? image_object.url : nil
  _title = image_object ? image_object.title : nil
  _link = image_object ? image_object.link : nil
  _width = image_object ? image_object.width : nil
  _height = image_object ? image_object.height : nil
  _description = image_object ? image_object.description : nil

  Struct.new(:url, :title, :link, :width, :height, :description).new(_url, _title, _link, _width, _height, _description)
end

#lastBuildDateObject Also known as: last_build_date



66
67
68
69
70
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 66

def lastBuildDate
  Time.parse(last_build_date_string).utc if last_build_date_string.present?
rescue ArgumentError
  nil
end

#managing_editorObject Also known as: managingeditor



77
78
79
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 77

def managing_editor
  managingEditor
end

#pubDateObject Also known as: pub_date, pubdate



58
59
60
61
62
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 58

def pubDate
  Time.parse(pub_date_string).utc if pub_date_string.present?
rescue ArgumentError
  nil
end

#web_masterObject Also known as: webmaster



82
83
84
# File 'lib/feedzirra-podcast/parser/rss2.rb', line 82

def web_master
  webMaster
end