Class: RSS::Maker::Base (Ruby 2.7.3)
Description: Class : RSS::Maker::Base - Ruby 2.7.3

### Home Classes Methods

### In Files

- rss/maker/base.rb

### Parent

Object

### Methods

- ::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
- ::inherited
- ::inherited_base
- ::need_initialize_variables
- ::new
- ::other_elements
- #have_required_values?
- #variable_is_set?

### Included Modules

- Enumerable

### Class/Module Index

Quicksearch

- RSS
- RSS::Atom
- RSS::Atom::CommonModel
- RSS::Atom::ContentModel
- RSS::Atom::ContentModel::ClassMethods
- RSS::Atom::DateConstruct
- RSS::Atom::DuplicateLinkChecker
- RSS::Atom::Entry
- RSS::Atom::Feed
- RSS::Atom::Feed::Author
- RSS::Atom::Feed::Category
- RSS::Atom::Feed::Contributor
- RSS::Atom::Feed::Entry
- RSS::Atom::Feed::Entry::Content
- RSS::Atom::Feed::Entry::Published
- RSS::Atom::Feed::Entry::Source
- RSS::Atom::Feed::Entry::Summary
- RSS::Atom::Feed::Generator
- RSS::Atom::Feed::Icon
- RSS::Atom::Feed::Id
- RSS::Atom::Feed::Link
- RSS::Atom::Feed::Logo
- RSS::Atom::Feed::Rights
- RSS::Atom::Feed::Subtitle
- RSS::Atom::Feed::Title
- RSS::Atom::Feed::Updated
- RSS::Atom::PersonConstruct
- RSS::Atom::PersonConstruct::Email
- RSS::Atom::PersonConstruct::Name
- RSS::Atom::PersonConstruct::Uri
- RSS::Atom::TextConstruct
- RSS::Atom::URIContentModel
- RSS::BaseDublinCoreModel
- RSS::BaseListener
- RSS::BaseModel
- RSS::BaseParser
- RSS::ContentModel
- RSS::ConversionError
- RSS::Converter
- RSS::DublinCoreModel
- RSS::DublincoreModel
- RSS::Element
- RSS::Error
- RSS::ITunesBaseModel
- RSS::ITunesChannelModel
- RSS::ITunesChannelModel::ITunesCategory
- RSS::ITunesChannelModel::ITunesImage
- RSS::ITunesChannelModel::ITunesOwner
- RSS::ITunesItemModel
- RSS::ITunesItemModel::ITunesDuration
- RSS::ITunesModelUtils
- RSS::ImageFaviconModel
- RSS::ImageFaviconModel::ImageFavicon
- RSS::ImageItemModel
- RSS::ImageItemModel::ImageItem
- RSS::ImageModelUtils
- RSS::InvalidRSSError
- RSS::ListenerMixin
- RSS::Maker
- RSS::Maker::Atom
- RSS::Maker::Atom::Entry
- RSS::Maker::Atom::Entry::Channel
- RSS::Maker::Atom::Entry::Channel::Cloud
- RSS::Maker::Atom::Entry::Channel::Description
- RSS::Maker::Atom::Entry::Channel::Generator
- RSS::Maker::Atom::Entry::Channel::SkipDays
- RSS::Maker::Atom::Entry::Channel::SkipDays::Day
- RSS::Maker::Atom::Entry::Channel::SkipHours
- RSS::Maker::Atom::Entry::Channel::SkipHours::Hour
- RSS::Maker::Atom::Entry::Image
- RSS::Maker::Atom::Entry::Items
- RSS::Maker::Atom::Entry::Items::Item
- RSS::Maker::Atom::Entry::Textinput
- RSS::Maker::Atom::Feed
- RSS::Maker::Atom::Feed::Channel
- RSS::Maker::Atom::Feed::Channel::Categories
- RSS::Maker::Atom::Feed::Channel::Categories::Category
- RSS::Maker::Atom::Feed::Channel::Cloud
- RSS::Maker::Atom::Feed::Channel::Generator
- RSS::Maker::Atom::Feed::Channel::Links
- RSS::Maker::Atom::Feed::Channel::Links::Link
- RSS::Maker::Atom::Feed::Channel::SkipDays
- RSS::Maker::Atom::Feed::Channel::SkipDays::Day
- RSS::Maker::Atom::Feed::Channel::SkipHours
- RSS::Maker::Atom::Feed::Channel::SkipHours::Hour
- RSS::Maker::Atom::Feed::Image
- RSS::Maker::Atom::Feed::Items
- RSS::Maker::Atom::Feed::Items::Item
- RSS::Maker::Atom::Feed::Items::Item::Categories
- RSS::Maker::Atom::Feed::Items::Item::Categories::Category
- RSS::Maker::Atom::Feed::Items::Item::Content
- RSS::Maker::Atom::Feed::Items::Item::Enclosure
- RSS::Maker::Atom::Feed::Items::Item::Guid
- RSS::Maker::Atom::Feed::Items::Item::Links
- RSS::Maker::Atom::Feed::Items::Item::Links::Link
- RSS::Maker::Atom::Feed::Items::Item::Source
- RSS::Maker::Atom::Feed::Items::Item::Source::Categories
- RSS::Maker::Atom::Feed::Items::Item::Source::Categories::Category
- RSS::Maker::Atom::Feed::Items::Item::Source::Generator
- RSS::Maker::Atom::Feed::Items::Item::Source::Icon
- RSS::Maker::Atom::Feed::Items::Item::Source::Links
- RSS::Maker::Atom::Feed::Items::Item::Source::Links::Link
- RSS::Maker::Atom::Feed::Items::Item::Source::Logo
- RSS::Maker::Atom::Feed::Textinput
- RSS::Maker::AtomCategory
- RSS::Maker::AtomGenerator
- RSS::Maker::AtomLink
- RSS::Maker::AtomLogo
- RSS::Maker::AtomPersonConstructBase
- RSS::Maker::AtomPersons
- RSS::Maker::AtomTextConstruct
- RSS::Maker::AtomTextConstructBase
- RSS::Maker::AtomTextConstructBase::EnsureXMLContent
- RSS::Maker::Base
- RSS::Maker::ChannelBase
- RSS::Maker::ChannelBase::AuthorsBase
- RSS::Maker::ChannelBase::AuthorsBase::AuthorBase
- RSS::Maker::ChannelBase::CategoriesBase
- RSS::Maker::ChannelBase::CategoriesBase::CategoryBase
- RSS::Maker::ChannelBase::CloudBase
- RSS::Maker::ChannelBase::ContributorsBase
- RSS::Maker::ChannelBase::ContributorsBase::ContributorBase
- RSS::Maker::ChannelBase::CopyrightBase
- RSS::Maker::ChannelBase::DescriptionBase
- RSS::Maker::ChannelBase::GeneratorBase
- RSS::Maker::ChannelBase::ITunesCategories
- RSS::Maker::ChannelBase::ITunesCategories::ITunesCategory
- RSS::Maker::ChannelBase::ITunesImage
- RSS::Maker::ChannelBase::ITunesOwner
- RSS::Maker::ChannelBase::LinksBase
- RSS::Maker::ChannelBase::LinksBase::LinkBase
- RSS::Maker::ChannelBase::SkipDaysBase
- RSS::Maker::ChannelBase::SkipDaysBase::DayBase
- RSS::Maker::ChannelBase::SkipHoursBase
- RSS::Maker::ChannelBase::SkipHoursBase::HourBase
- RSS::Maker::ChannelBase::TitleBase
- RSS::Maker::ContentModel
- RSS::Maker::DublinCoreModel
- RSS::Maker::ITunesBaseModel
- RSS::Maker::ITunesChannelModel
- RSS::Maker::ITunesChannelModel::ITunesCategoriesBase
- RSS::Maker::ITunesChannelModel::ITunesCategoriesBase::ITunesCategoryBase
- RSS::Maker::ITunesChannelModel::ITunesImageBase
- RSS::Maker::ITunesChannelModel::ITunesOwnerBase
- RSS::Maker::ITunesItemModel
- RSS::Maker::ITunesItemModel::ITunesDurationBase
- RSS::Maker::ImageBase
- RSS::Maker::ImageFaviconModel
- RSS::Maker::ImageFaviconModel::ImageFaviconBase
- RSS::Maker::ImageItemModel
- RSS::Maker::ImageItemModel::ImageItemBase
- RSS::Maker::ItemsBase
- RSS::Maker::ItemsBase::ItemBase
- RSS::Maker::ItemsBase::ItemBase::ContentBase
- RSS::Maker::ItemsBase::ItemBase::DescriptionBase
- RSS::Maker::ItemsBase::ItemBase::EnclosureBase
- RSS::Maker::ItemsBase::ItemBase::GuidBase
- RSS::Maker::ItemsBase::ItemBase::ITunesDuration
- RSS::Maker::ItemsBase::ItemBase::RightsBase
- RSS::Maker::ItemsBase::ItemBase::SourceBase
- RSS::Maker::ItemsBase::ItemBase::SourceBase::IconBase
- RSS::Maker::ItemsBase::ItemBase::SourceBase::LogoBase
- RSS::Maker::ItemsBase::ItemBase::SourceBase::RightsBase
- RSS::Maker::ItemsBase::ItemBase::SourceBase::SubtitleBase
- RSS::Maker::ItemsBase::ItemBase::SourceBase::TitleBase
- RSS::Maker::ItemsBase::ItemBase::TitleBase
- RSS::Maker::RSS09
- RSS::Maker::RSS091
- RSS::Maker::RSS091::Channel
- RSS::Maker::RSS091::Image
- RSS::Maker::RSS091::Items
- RSS::Maker::RSS091::Items::Item
- RSS::Maker::RSS091::Textinput
- RSS::Maker::RSS092
- RSS::Maker::RSS092::Channel
- RSS::Maker::RSS092::Image
- RSS::Maker::RSS092::Items
- RSS::Maker::RSS092::Items::Item
- RSS::Maker::RSS092::Textinput
- RSS::Maker::RSS09::Channel
- RSS::Maker::RSS09::Channel::Authors
- RSS::Maker::RSS09::Channel::Authors::Author
- RSS::Maker::RSS09::Channel::Categories
- RSS::Maker::RSS09::Channel::Categories::Category
- RSS::Maker::RSS09::Channel::Cloud
- RSS::Maker::RSS09::Channel::Contributors
- RSS::Maker::RSS09::Channel::Contributors::Contributor
- RSS::Maker::RSS09::Channel::Copyright
- RSS::Maker::RSS09::Channel::Description
- RSS::Maker::RSS09::Channel::Generator
- RSS::Maker::RSS09::Channel::Links
- RSS::Maker::RSS09::Channel::Links::Link
- RSS::Maker::RSS09::Channel::SkipDays
- RSS::Maker::RSS09::Channel::SkipDays::Day
- RSS::Maker::RSS09::Channel::SkipHours
- RSS::Maker::RSS09::Channel::SkipHours::Hour
- RSS::Maker::RSS09::Channel::Title
- RSS::Maker::RSS09::Image
- RSS::Maker::RSS09::Items
- RSS::Maker::RSS09::Items::Item
- RSS::Maker::RSS09::Items::Item::Authors
- RSS::Maker::RSS09::Items::Item::Authors::Author
- RSS::Maker::RSS09::Items::Item::Categories
- RSS::Maker::RSS09::Items::Item::Categories::Category
- RSS::Maker::RSS09::Items::Item::Content
- RSS::Maker::RSS09::Items::Item::Contributors
- RSS::Maker::RSS09::Items::Item::Contributors::Contributor
- RSS::Maker::RSS09::Items::Item::Description
- RSS::Maker::RSS09::Items::Item::Enclosure
- RSS::Maker::RSS09::Items::Item::Guid
- RSS::Maker::RSS09::Items::Item::Links
- RSS::Maker::RSS09::Items::Item::Links::Link
- RSS::Maker::RSS09::Items::Item::Rights
- RSS::Maker::RSS09::Items::Item::Source
- RSS::Maker::RSS09::Items::Item::Source::Authors
- RSS::Maker::RSS09::Items::Item::Source::Authors::Author
- RSS::Maker::RSS09::Items::Item::Source::Categories
- RSS::Maker::RSS09::Items::Item::Source::Categories::Category
- RSS::Maker::RSS09::Items::Item::Source::Contributors
- RSS::Maker::RSS09::Items::Item::Source::Contributors::Contributor
- RSS::Maker::RSS09::Items::Item::Source::Generator
- RSS::Maker::RSS09::Items::Item::Source::Icon
- RSS::Maker::RSS09::Items::Item::Source::Links
- RSS::Maker::RSS09::Items::Item::Source::Links::Link
- RSS::Maker::RSS09::Items::Item::Source::Logo
- RSS::Maker::RSS09::Items::Item::Source::Rights
- RSS::Maker::RSS09::Items::Item::Source::Subtitle
- RSS::Maker::RSS09::Items::Item::Source::Title
- RSS::Maker::RSS09::Items::Item::Title
- RSS::Maker::RSS09::Textinput
- RSS::Maker::RSS10
- RSS::Maker::RSS10::Channel
- RSS::Maker::RSS10::Channel::Authors
- RSS::Maker::RSS10::Channel::Authors::Author
- RSS::Maker::RSS10::Channel::Categories
- RSS::Maker::RSS10::Channel::Categories::Category
- RSS::Maker::RSS10::Channel::Cloud
- RSS::Maker::RSS10::Channel::Contributors
- RSS::Maker::RSS10::Channel::Contributors::Contributor
- RSS::Maker::RSS10::Channel::Copyright
- RSS::Maker::RSS10::Channel::Description
- RSS::Maker::RSS10::Channel::Generator
- RSS::Maker::RSS10::Channel::Links
- RSS::Maker::RSS10::Channel::Links::Link
- RSS::Maker::RSS10::Channel::SkipDays
- RSS::Maker::RSS10::Channel::SkipDays::Day
- RSS::Maker::RSS10::Channel::SkipHours
- RSS::Maker::RSS10::Channel::SkipHours::Hour
- RSS::Maker::RSS10::Channel::Title
- RSS::Maker::RSS10::Image
- RSS::Maker::RSS10::Items
- RSS::Maker::RSS10::Items::Item
- RSS::Maker::RSS10::Items::Item::Authors
- RSS::Maker::RSS10::Items::Item::Authors::Author
- RSS::Maker::RSS10::Items::Item::Categories
- RSS::Maker::RSS10::Items::Item::Categories::Category
- RSS::Maker::RSS10::Items::Item::Content
- RSS::Maker::RSS10::Items::Item::Contributors
- RSS::Maker::RSS10::Items::Item::Contributors::Contributor
- RSS::Maker::RSS10::Items::Item::Description
- RSS::Maker::RSS10::Items::Item::Enclosure
- RSS::Maker::RSS10::Items::Item::Guid
- RSS::Maker::RSS10::Items::Item::Links
- RSS::Maker::RSS10::Items::Item::Links::Link
- RSS::Maker::RSS10::Items::Item::Rights
- RSS::Maker::RSS10::Items::Item::Source
- RSS::Maker::RSS10::Items::Item::Source::Authors
- RSS::Maker::RSS10::Items::Item::Source::Authors::Author
- RSS::Maker::RSS10::Items::Item::Source::Categories
- RSS::Maker::RSS10::Items::Item::Source::Categories::Category
- RSS::Maker::RSS10::Items::Item::Source::Contributors
- RSS::Maker::RSS10::Items::Item::Source::Contributors::Contributor
- RSS::Maker::RSS10::Items::Item::Source::Generator
- RSS::Maker::RSS10::Items::Item::Source::Icon
- RSS::Maker::RSS10::Items::Item::Source::Links
- RSS::Maker::RSS10::Items::Item::Source::Links::Link
- RSS::Maker::RSS10::Items::Item::Source::Logo
- RSS::Maker::RSS10::Items::Item::Source::Rights
- RSS::Maker::RSS10::Items::Item::Source::Subtitle
- RSS::Maker::RSS10::Items::Item::Source::Title
- RSS::Maker::RSS10::Items::Item::Title
- RSS::Maker::RSS10::Textinput
- RSS::Maker::RSS20
- RSS::Maker::RSS20::Channel
- RSS::Maker::RSS20::Channel::Categories
- RSS::Maker::RSS20::Channel::Categories::Category
- RSS::Maker::RSS20::Channel::Cloud
- RSS::Maker::RSS20::Channel::Generator
- RSS::Maker::RSS20::Channel::SkipDays
- RSS::Maker::RSS20::Channel::SkipDays::Day
- RSS::Maker::RSS20::Channel::SkipHours
- RSS::Maker::RSS20::Channel::SkipHours::Hour
- RSS::Maker::RSS20::Image
- RSS::Maker::RSS20::Items
- RSS::Maker::RSS20::Items::Item
- RSS::Maker::RSS20::Items::Item::Authors
- RSS::Maker::RSS20::Items::Item::Authors::Author
- RSS::Maker::RSS20::Items::Item::Categories
- RSS::Maker::RSS20::Items::Item::Categories::Category
- RSS::Maker::RSS20::Items::Item::Enclosure
- RSS::Maker::RSS20::Items::Item::Guid
- RSS::Maker::RSS20::Items::Item::Source
- RSS::Maker::RSS20::Items::Item::Source::Links
- RSS::Maker::RSS20::Items::Item::Source::Links::Link
- RSS::Maker::RSS20::Textinput
- RSS::Maker::RSSBase
- RSS::Maker::SetupDefaultDate
- RSS::Maker::SetupDefaultLanguage
- RSS::Maker::SlashModel
- RSS::Maker::SyndicationModel
- RSS::Maker::TaxonomyTopicModel
- RSS::Maker::TaxonomyTopicModel::TaxonomyTopicsBase
- RSS::Maker::TaxonomyTopicModel::TaxonomyTopicsBase::TaxonomyTopicBase
- RSS::Maker::TaxonomyTopicsModel
- RSS::Maker::TaxonomyTopicsModel::TaxonomyTopicsBase
- RSS::Maker::TextinputBase
- RSS::Maker::TrackBackModel
- RSS::Maker::TrackBackModel::TrackBackAboutsBase
- RSS::Maker::TrackBackModel::TrackBackAboutsBase::TrackBackAboutBase
- RSS::Maker::XMLStyleSheets
- RSS::Maker::XMLStyleSheets::XMLStyleSheet
- RSS::MissingAttributeError
- RSS::MissingTagError
- RSS::NSError
- RSS::NotAvailableValueError
- RSS::NotExpectedTagError
- RSS::NotSetError
- RSS::NotValidXMLParser
- RSS::NotWellFormedError
- RSS::OverlappedPrefixError
- RSS::Parser
- RSS::RDF::Bag
- RSS::RDF::Bag::Li
- RSS::RDF::Channel
- RSS::RDF::Channel::Image
- RSS::RDF::Channel::Items
- RSS::RDF::Channel::Items::Seq
- RSS::RDF::Channel::Textinput
- RSS::RDF::Image
- RSS::RDF::Li
- RSS::RDF::Seq
- RSS::RDF::Seq::Li
- RSS::RDF::Textinput
- RSS::REXMLLikeXMLParser
- RSS::REXMLListener
- RSS::REXMLParser
- RSS::RSS09
- RSS::RSS10
- RSS::RootElementMixin
- RSS::Rss::Channel::Cloud
- RSS::Rss::Channel::Image
- RSS::Rss::Channel::Item::Category
- RSS::Rss::Channel::Item::Enclosure
- RSS::Rss::Channel::Item::Guid
- RSS::Rss::Channel::Item::Source
- RSS::Rss::Channel::SkipDays
- RSS::Rss::Channel::SkipDays::Day
- RSS::Rss::Channel::SkipHours
- RSS::Rss::Channel::SkipHours::Hour
- RSS::Rss::Channel::TextInput
- RSS::SetupMaker
- RSS::SlashModel
- RSS::SyndicationModel
- RSS::TaxonomyTopicModel
- RSS::TaxonomyTopicModel::TaxonomyTopic
- RSS::TaxonomyTopicsModel
- RSS::TaxonomyTopicsModel::TaxonomyTopics
- RSS::TaxonomyTopicsModel::TaxonomyTopics::Bag
- RSS::TooMuchTagError
- RSS::UnknownConversionMethodError
- RSS::UnknownTagError
- RSS::UnsupportedMakerVersionError
- RSS::Utils
- RSS::Utils::CSV
- RSS::Utils::ExplicitCleanOther
- RSS::Utils::InheritedReader
- RSS::Utils::YesOther
- RSS::XML
- RSS::XML::Element
- RSS::XMLParserListener
- RSS::XMLParserNotFound
- RSS::XMLParserParser
- RSS::XMLScanListener
- RSS::XMLScanParser
- RSS::XMLStyleSheet
- RSS::XMLStyleSheetMixin
- Time
- XML
- XML::Parser
- XMLEncoding_ja
- XMLEncoding_ja::SJISHandler

No matching classes.

# RSS::Maker::Base

### Constants

NEED_INITIALIZE_VARIABLES
OTHER_ELEMENTS

### Attributes

maker[R]

### Public Class Methods

add_need_initialize_variable(variable_name, init_value=nil, &init_block) click to toggle source

                   # File rss/maker/base.rb, line 35
    def add_need_initialize_variable(variable_name, init_value=nil,
                                     &init_block)
      init_value ||= init_block
      self::NEED_INITIALIZE_VARIABLES << [variable_name, init_value]
    end

add_other_element(variable_name) click to toggle source

                   # File rss/maker/base.rb, line 31
    def add_other_element(variable_name)
      self::OTHER_ELEMENTS << variable_name
    end

def_array_element(name, plural=nil, klass_name=nil) click to toggle source

                   # File rss/maker/base.rb, line 41
            def def_array_element(name, plural=nil, klass_name=nil)
              include Enumerable
              extend Forwardable

              plural ||= "#{name}s"
              klass_name ||= Utils.to_class_name(name)
              def_delegators("@#{plural}", :<<, :[], :[]=, :first, :last)
              def_delegators("@#{plural}", :push, :pop, :shift, :unshift)
              def_delegators("@#{plural}", :each, :size, :empty?, :clear)

              add_need_initialize_variable(plural) {[]}

              module_eval(<<-EOC, __FILE__, __LINE__ + 1)
                def new_#{name}
                  #{name} = self.class::#{klass_name}.new(@maker)
                  @#{plural} << #{name}
                  if block_given?
                    yield #{name}
                  else
                    #{name}
                  end
                end
                alias new_child new_#{name}

                def to_feed(*args)
                  @#{plural}.each do |#{name}|
                    #{name}.to_feed(*args)
                  end
                end

                def replace(elements)
                  @#{plural}.replace(elements.to_a)
                end
              EOC
            end

def_classed_element(name, class_name=nil, attribute_name=nil) click to toggle source

                   # File rss/maker/base.rb, line 95
            def def_classed_element(name, class_name=nil, attribute_name=nil)
              def_classed_element_without_accessor(name, class_name)
              if attribute_name
                module_eval(<<-EOC, __FILE__, __LINE__ + 1)
                  def #{name}
                    if block_given?
                      yield(@#{name})
                    else
                      @#{name}.#{attribute_name}
                    end
                  end

                  def #{name}=(new_value)
                    @#{name}.#{attribute_name} = new_value
                  end
                EOC
              else
                attr_reader name
              end
            end

def_classed_element_without_accessor(name, class_name=nil) click to toggle source

                   # File rss/maker/base.rb, line 77
            def def_classed_element_without_accessor(name, class_name=nil)
              class_name ||= Utils.to_class_name(name)
              add_other_element(name)
              add_need_initialize_variable(name) do |object|
                object.send("make_#{name}")
              end
              module_eval(<<-EOC, __FILE__, __LINE__ + 1)
                private
                def setup_#{name}(feed, current)
                  @#{name}.to_feed(feed, current)
                end

                def make_#{name}
                  self.class::#{class_name}.new(@maker)
                end
              EOC
            end

def_classed_elements(name, attribute, plural_class_name=nil, plural_name=nil, new_name=nil) click to toggle source

                   # File rss/maker/base.rb, line 116
            def def_classed_elements(name, attribute, plural_class_name=nil,
                                     plural_name=nil, new_name=nil)
              plural_name ||= "#{name}s"
              new_name ||= name
              def_classed_element(plural_name, plural_class_name)
              local_variable_name = "_#{name}"
              new_value_variable_name = "new_value"
              additional_setup_code = nil
              if block_given?
                additional_setup_code = yield(local_variable_name,
                                              new_value_variable_name)
              end
              module_eval(<<-EOC, __FILE__, __LINE__ + 1)
                def #{name}
                  #{local_variable_name} = #{plural_name}.first
                  #{local_variable_name} ? #{local_variable_name}.#{attribute} : nil
                end

                def #{name}=(#{new_value_variable_name})
                  #{local_variable_name} =
                    #{plural_name}.first || #{plural_name}.new_#{new_name}
                  #{additional_setup_code}
                  #{local_variable_name}.#{attribute} = #{new_value_variable_name}
                end
              EOC
            end

def_csv_element(name, type=nil) click to toggle source

                   # File rss/maker/base.rb, line 160
            def def_csv_element(name, type=nil)
              def_other_element_without_accessor(name)
              attr_reader(name)
              converter = ""
              if type == :integer
                converter = "{|v| Integer(v)}"
              end
              module_eval(<<-EOC, __FILE__, __LINE__ + 1)
                def #{name}=(value)
                  @#{name} = Utils::CSV.parse(value)#{converter}
                end
              EOC
            end

def_other_element(name) click to toggle source

                   # File rss/maker/base.rb, line 143
    def def_other_element(name)
      attr_accessor name
      def_other_element_without_accessor(name)
    end

def_other_element_without_accessor(name) click to toggle source

                   # File rss/maker/base.rb, line 148
            def def_other_element_without_accessor(name)
              add_need_initialize_variable(name)
              add_other_element(name)
              module_eval(<<-EOC, __FILE__, __LINE__ + 1)
                def setup_#{name}(feed, current)
                  if !@#{name}.nil? and current.respond_to?(:#{name}=)
                    current.#{name} = @#{name}
                  end
                end
              EOC
            end

inherited(subclass) click to toggle source

                   # File rss/maker/base.rb, line 26
    def inherited(subclass)
      subclass.const_set(:OTHER_ELEMENTS, [])
      subclass.const_set(:NEED_INITIALIZE_VARIABLES, [])
    end

inherited_base() click to toggle source

                   # File rss/maker/base.rb, line 22
    def inherited_base
      ::RSS::Maker::Base
    end

need_initialize_variables() click to toggle source

                   # File rss/maker/base.rb, line 18
    def need_initialize_variables
      inherited_array_reader("NEED_INITIALIZE_VARIABLES")
    end

new(maker) click to toggle source

                   # File rss/maker/base.rb, line 176
    def initialize(maker)
      @maker = maker
      @default_values_are_set = false
      initialize_variables
    end

other_elements() click to toggle source

                   # File rss/maker/base.rb, line 15
    def other_elements
      inherited_array_reader("OTHER_ELEMENTS")
    end

### Public Instance Methods

have_required_values?() click to toggle source

                   # File rss/maker/base.rb, line 182
    def have_required_values?
      not_set_required_variables.empty?
    end

variable_is_set?() click to toggle source

                   # File rss/maker/base.rb, line 186
    def variable_is_set?
      variables.any? {|var| not __send__(var).nil?}
    end