Class: Syndication::RSS::Channel

Inherits:
Container show all
Includes:
Content, DublinCore, Podcast::Both, Podcast::Channel
Defined in:
lib/syndication/rss.rb,
lib/syndication/content.rb,
lib/syndication/podcast.rb,
lib/syndication/dublincore.rb

Overview

Represents metadata about an RSS feed as a whole. Typically found via the Syndication::RSS::Feed#channel method.

Instance Attribute Summary collapse

Attributes included from DublinCore

#dc_contributor, #dc_coverage, #dc_creator, #dc_date, #dc_description, #dc_format, #dc_identifier, #dc_language, #dc_publisher, #dc_relation, #dc_rights, #dc_source, #dc_subject, #dc_title, #dc_type

Attributes included from Podcast::Both

#itunes_block, #itunes_category, #itunes_explicit, #itunes_keywords, #itunes_subtitle, #itunes_summary

Attributes included from Podcast::Channel

#itunes_owner

Attributes included from Content

#content_encoded

Instance Method Summary collapse

Methods included from Content

#content_decoded

Methods inherited from Container

#initialize, #parse_date, #store, #store_category, #strip, #tag2method, #tag_end, #tag_start

Constructor Details

This class inherits a constructor from Syndication::Container

Instance Attribute Details

#categoryObject

One or more categories for the channel, as an Array of Strings.



151
152
153
# File 'lib/syndication/rss.rb', line 151

def category
  @category
end

#cloudObject

rssCloud interface (for Radio UserLand).



160
161
162
# File 'lib/syndication/rss.rb', line 160

def cloud
  @cloud
end

Copyright statement for channel.



136
137
138
# File 'lib/syndication/rss.rb', line 136

def copyright
  @copyright
end

#descriptionObject

A textual description of the channel.



134
135
136
# File 'lib/syndication/rss.rb', line 134

def description
  @description
end

#docsObject

The URL of some documentation on what the RSS format is.



156
157
158
# File 'lib/syndication/rss.rb', line 156

def docs
  @docs
end

#generatorObject

The software that generated the channel.



154
155
156
# File 'lib/syndication/rss.rb', line 154

def generator
  @generator
end

#imageObject

The graphical image to represent the channel, as a Syndication::Image object.



149
150
151
# File 'lib/syndication/rss.rb', line 149

def image
  @image
end

#languageObject

ISO code for the language the channel is written in.



138
139
140
# File 'lib/syndication/rss.rb', line 138

def language
  @language
end

#lastbuilddateObject

Last time content in channel changed, as a DateTime object if it can be parsed by DateTime; otherwise, as a String.



180
181
182
# File 'lib/syndication/rss.rb', line 180

def lastbuilddate
  return parse_date(@lastbuilddate)
end

The URL of the web site this is a channel for.



132
133
134
# File 'lib/syndication/rss.rb', line 132

def link
  @link
end

#managingeditorObject

E-mail address of person responsible for editorial content.



140
141
142
# File 'lib/syndication/rss.rb', line 140

def managingeditor
  @managingeditor
end

#pubdateObject

Publication date of content in channel, as a DateTime object if it can be parsed by DateTime; otherwise, as a String.



174
175
176
# File 'lib/syndication/rss.rb', line 174

def pubdate
  return parse_date(@pubdate)
end

#ratingObject

PICS rating for channel.



162
163
164
# File 'lib/syndication/rss.rb', line 162

def rating
  @rating
end

#skipdaysObject (readonly)

Full names (in English) of days when the feed can be skipped.



170
171
172
# File 'lib/syndication/rss.rb', line 170

def skipdays
  @skipdays
end

#skiphoursObject (readonly)

Hours when the feed can be skipped (because it will not have new content). Returned as an Array of values in the range 0..23 (even if parsing the UserLand variant of RSS 0.91).



168
169
170
# File 'lib/syndication/rss.rb', line 168

def skiphours
  @skiphours
end

#textinputObject

The TextInput area as a Syndication::TextInput object.



164
165
166
# File 'lib/syndication/rss.rb', line 164

def textinput
  @textinput
end

#titleObject

The title of the channel.



130
131
132
# File 'lib/syndication/rss.rb', line 130

def title
  @title
end

#ttlObject

Time to live for this copy of the channel.



158
159
160
# File 'lib/syndication/rss.rb', line 158

def ttl
  @ttl
end

#webmasterObject

E-mail address of person responsible for technical issues with feed.



142
143
144
# File 'lib/syndication/rss.rb', line 142

def webmaster
  @webmaster
end

Instance Method Details

#day=(dayname) ⇒ Object

Add a day name to the list of days to skip.

The <day> element in fact comes inside <skipDays>, but we don't enforce that; we just make the Channel recognize it and store the values.



202
203
204
205
206
207
208
209
# File 'lib/syndication/rss.rb', line 202

def day=(dayname)
  if dayname.kind_of?(String)
    if !defined? @skipdays
      @skipdays = Array.new
    end
    @skipdays << dayname
  end
end

#hour=(hr) ⇒ Object

Add an hour to the list of hours to skip.

The <hour> element in fact comes inside <skipHours>, but we don't enforce that; we just make the Channel recognize it and store the values.



188
189
190
191
192
193
194
195
196
# File 'lib/syndication/rss.rb', line 188

def hour=(hr)
  if hr.kind_of?(String)
    if !defined? @skiphours
      @skiphours = Array.new
    end
    h = hr.to_i
    @skiphours << (h == 24 ? 0 : h)
  end
end