Module: RSS::SyndicationModel

Module | RSS::SyndicationModel
In: | rss/syndication.rb

### Methods

append_features sy_validate

### Constants

ELEMENTS | = | []
SY_UPDATEPERIOD_AVAILABLE_VALUES | = | %w(hourly daily weekly monthly yearly)
SY_UPDATEFREQUENCY_AVAILABLE_RE | = | /\A\s*\+?\d+\s*\z/

### Public Class methods

append_features(klass)

[Source]

    # File rss/syndication.rb, line 16
        def self.append_features(klass)
          super

          klass.module_eval("%w(updatePeriod updateFrequency).each do |name|\ninstall_text_element(\"\\\#{SY_PREFIX}_\\\#{name}\")\nend\n\n%w(updateBase).each do |name|\ninstall_date_element(\"\\\#{SY_PREFIX}_\\\#{name}\", 'w3cdtf', name)\nend\n\nalias_method(:_sy_updatePeriod=, :sy_updatePeriod=)\ndef sy_updatePeriod=(new_value)\nnew_value = new_value.strip\nvalidate_sy_updatePeriod(new_value) if @do_validate\nself._sy_updatePeriod = new_value\nend\n\nalias_method(:_sy_updateFrequency=, :sy_updateFrequency=)\ndef sy_updateFrequency=(new_value)\nvalidate_sy_updateFrequency(new_value) if @do_validate\nself._sy_updateFrequency = new_value.to_i\nend\n", *get_file_and_line_from_caller(1))
        end

### Public Instance methods

sy_validate(tags)

[Source]

    # File rss/syndication.rb, line 44
        def sy_validate(tags)
          counter = {}
          ELEMENTS.each do |name|
            counter[name] = 0
          end

          tags.each do |tag|
            key = "#{SY_PREFIX}_#{tag}"
            raise UnknownTagError.new(tag, SY_URI)  unless counter.has_key?(key)
            counter[key] += 1
            raise TooMuchTagError.new(tag, tag_name) if counter[key] > 1
          end
        end

[Validate]