| Module | RSS::BaseDublinCoreModel |
| In: |
rss/dublincore.rb
|
# File rss/dublincore.rb, line 11 def append_features(klass) super return if klass.instance_of?(Module) DublinCoreModel::ELEMENT_NAME_INFOS.each do |name, plural_name| plural = plural_name || "#{name}s" full_name = "#{DC_PREFIX}_#{name}" full_plural_name = "#{DC_PREFIX}_#{plural}" klass_name = "DublinCore#{Utils.to_class_name(name)}" klass.install_must_call_validator(DC_PREFIX, DC_URI) klass.install_have_children_element(name, DC_URI, "*", full_name, full_plural_name) klass.module_eval("remove_method :\#{full_name}\nremove_method :\#{full_name}=\nremove_method :set_\#{full_name}\n\ndef \#{full_name}\n@\#{full_name}.first and @\#{full_name}.first.value\nend\n\ndef \#{full_name}=(new_value)\n@\#{full_name}[0] = Utils.new_with_value_if_need(\#{klass_name}, new_value)\nend\nalias set_\#{full_name} \#{full_name}=\n", *get_file_and_line_from_caller(0)) end klass.module_eval("alias date \#{DC_PREFIX}_date\nalias date= \#{DC_PREFIX}_date=\n", *get_file_and_line_from_caller(0)) end
ruby-doc.org is hosted and maintained by James Britt and Happy Camper Studios, a Ruby application development company in Phoenix, Arizona. The site was created in 2002 as part of the Ruby Documentation Project to promote the Ruby language and to help other Ruby hackers.
Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.
For more information on the Ruby programming language, visit ruby-lang.org.
Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.