Maintenance of Ruby 2.0.0 ended on February 24, 2016. Read more

In Files

  • rss/maker/atom.rb

Class/Module Index [+]

Quicksearch

RSS::Maker::AtomPersons

Public Instance Methods

def_atom_persons(klass, name, maker_name, plural=nil) click to toggle source
 
               # File rss/maker/atom.rb, line 9
      def def_atom_persons(klass, name, maker_name, plural=nil)
        plural ||= "#{name}s"
        klass_name = Utils.to_class_name(name)
        plural_klass_name = Utils.to_class_name(plural)

        klass.class_eval("          class #{plural_klass_name} < #{plural_klass_name}Base
            class #{klass_name} < #{klass_name}Base
              def to_feed(feed, current)
                #{name} = feed.class::#{klass_name}.new
                set = setup_values(#{name})
                unless set
                  raise NotSetError.new(#{maker_name.dump},
                                        not_set_required_variables)
                end
                current.#{plural} << #{name}
                set_parent(#{name}, current)
                setup_other_elements(#{name})
              end

              private
              def required_variable_names
                %w(name)
              end
            end
          end
", __FILE__, __LINE__ + 1)
      end