append_features(klass) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rss/maker/dublincore.rb, line 7
      def self.append_features(klass)
        super

        ::RSS::DublinCoreModel::ELEMENT_NAME_INFOS.each do |name, plural_name|
          plural_name ||= "#{name}s"
          full_name = "#{RSS::DC_PREFIX}_#{name}"
          full_plural_name = "#{RSS::DC_PREFIX}_#{plural_name}"
          klass_name = Utils.to_class_name(name)
          plural_klass_name = "DublinCore#{Utils.to_class_name(plural_name)}"
          full_plural_klass_name = "self.class::#{plural_klass_name}"
          full_klass_name = "#{full_plural_klass_name}::#{klass_name}"
          klass.def_classed_elements(full_name, "value", plural_klass_name,
                                     full_plural_name, name)
          klass.module_eval("def new_\#{full_name}(value=nil)\n_\#{full_name} = \#{full_plural_name}.new_\#{name}\n_\#{full_name}.value = value\nif block_given?\nyield _\#{full_name}\nelse\n_\#{full_name}\nend\nend\n", __FILE__, __LINE__ + 1)
        end

        klass.module_eval("# For backward compatibility\nalias \#{DC_PREFIX}_rightses \#{DC_PREFIX}_rights_list\n", __FILE__, __LINE__ + 1)
      end
Register or log in to add new notes.