Class: RSS::Maker::RSSBase

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

Direct Known Subclasses

Atom::Entry, Atom::Feed, RSS09, RSS10

Constant Summary

Constants inherited from Base

Base::NEED_INITIALIZE_VARIABLES, Base::OTHER_ELEMENTS

Instance Attribute Summary collapse

Attributes inherited from Base

#maker

Class Method Summary collapse

Instance Method Summary collapse

Methods included from TaxonomyTopicModel

append_features, install_taxo_topic

Methods inherited from Base

add_need_initialize_variable, add_other_element, def_array_element, def_classed_element, def_classed_element_without_accessor, def_classed_elements, def_csv_element, def_other_element, def_other_element_without_accessor, #have_required_values?, inherited, inherited_base, need_initialize_variables, other_elements, #variable_is_set?

Methods included from Utils::InheritedReader

#inherited_array_reader, #inherited_hash_reader, #inherited_reader

Constructor Details

#initialize(feed_version) ⇒ RSSBase

Returns a new instance of RSSBase.



428
429
430
431
432
433
434
435
436
# File 'lib/rss/maker/base.rb', line 428

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

Instance Attribute Details

#encodingObject

Returns the value of attribute encoding.



426
427
428
# File 'lib/rss/maker/base.rb', line 426

def encoding
  @encoding
end

#feed_versionObject (readonly) Also known as: rss_version

Returns the value of attribute feed_version.



424
425
426
# File 'lib/rss/maker/base.rb', line 424

def feed_version
  @feed_version
end

#standaloneObject

Returns the value of attribute standalone.



426
427
428
# File 'lib/rss/maker/base.rb', line 426

def standalone
  @standalone
end

#versionObject

Returns the value of attribute version.



426
427
428
# File 'lib/rss/maker/base.rb', line 426

def version
  @version
end

Class Method Details

.make(*args, &block) ⇒ Object



402
403
404
# File 'lib/rss/maker/base.rb', line 402

def make(*args, &block)
  new(*args).make(&block)
end

Instance Method Details

#make {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



438
439
440
441
# File 'lib/rss/maker/base.rb', line 438

def make
  yield(self)
  to_feed
end

#to_feedObject



443
444
445
446
447
448
449
450
# File 'lib/rss/maker/base.rb', line 443

def to_feed
  feed = make_feed
  setup_xml_stylesheets(feed)
  setup_elements(feed)
  setup_other_elements(feed)
  feed.validate
  feed
end