module RSS::Maker - rss: Ruby Standard Library Documentation

# module RSS::Maker

Provides a set of builders for various `RSS` objects

- Feeds

  - `RSS` 0.91

  - `RSS` 1.0

  - `RSS` 2.0

  - `Atom` 1.0

- Elements

  - `Atom::Entry`

### Constants

MAKERS

  Collection of supported makers

### Public Class Methods

[](version) click to toggle source

Returns the maker for the `version`

    # File rss-0.3.1/lib/rss/maker.rb, line 33
    def [](version)
      maker_info = maker(version)
      raise UnsupportedMakerVersionError.new(version) if maker_info.nil?
      maker_info[:maker]
    end

add_maker(version, normalized_version, maker) click to toggle source

Adds a maker to the set of supported makers

    # File rss-0.3.1/lib/rss/maker.rb, line 40
    def add_maker(version, normalized_version, maker)
      MAKERS[version] = {:maker => maker, :version => normalized_version}
    end

make(version, &block) click to toggle source

Builder for an `RSS` object Creates an object of the type passed in `args`

Executes the `block` to populate elements of the created `RSS` object

    # File rss-0.3.1/lib/rss/maker.rb, line 28
    def make(version, &block)
      self[version].make(&block)
    end

makers() click to toggle source

Returns collection of supported makers

    # File rss-0.3.1/lib/rss/maker.rb, line 50
    def makers
      MAKERS.values.collect { |info| info[:maker] }.uniq
    end

supported?(version) click to toggle source

Returns true if the version is supported

    # File rss-0.3.1/lib/rss/maker.rb, line 55
    def supported?(version)
      versions.include?(version)
    end

versions() click to toggle source

Returns collection of supported maker versions

    # File rss-0.3.1/lib/rss/maker.rb, line 45
    def versions
      MAKERS.keys.uniq.sort
    end

### Private Class Methods

maker(version) click to toggle source

Can I remove this method?

    # File rss-0.3.1/lib/rss/maker.rb, line 61
    def maker(version)
      MAKERS[version]
    end