Class: RSS::Maker::RSSBase

Inherits:
Object
  • Object
show all
Includes:
Base, TaxonomyTopicModel
Defined in:
lib/rss/maker/base.rb,
lib/rss/maker/taxonomy.rb

Direct Known Subclasses

RSS09, RSS10

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TaxonomyTopicModel

append_features, install_taxo_topic

Methods included from Base

append_features, #have_required_values?

Constructor Details

#initialize(rss_version) ⇒ RSSBase

Returns a new instance of RSSBase.



159
160
161
162
163
164
165
# File 'lib/rss/maker/base.rb', line 159

def initialize(rss_version)
  super(self)
  @rss_version = rss_version
  @version = "1.0"
  @encoding = "UTF-8"
  @standalone = nil
end

Instance Attribute Details

#encodingObject

Returns the value of attribute encoding.



157
158
159
# File 'lib/rss/maker/base.rb', line 157

def encoding
  @encoding
end

#rss_versionObject (readonly)

Returns the value of attribute rss_version.



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

def rss_version
  @rss_version
end

#standaloneObject

Returns the value of attribute standalone.



157
158
159
# File 'lib/rss/maker/base.rb', line 157

def standalone
  @standalone
end

#versionObject

Returns the value of attribute version.



157
158
159
# File 'lib/rss/maker/base.rb', line 157

def version
  @version
end

Class Method Details

.make(&block) ⇒ Object



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

def make(&block)
  new.make(&block)
end

Instance Method Details

#makeObject



167
168
169
170
171
172
173
174
# File 'lib/rss/maker/base.rb', line 167

def make
  if block_given?
    yield(self)
    to_rss
  else
    nil
  end
end

#to_rssObject



176
177
178
179
180
181
182
183
184
185
186
# File 'lib/rss/maker/base.rb', line 176

def to_rss
  rss = make_rss
  setup_xml_stylesheets(rss)
  setup_elements(rss)
  setup_other_elements(rss)
  if rss.channel
    rss
  else
    nil
  end
end