模块 RSS::Maker::TaxonomyTopicsModel
公共类方法
append_features(klass) 点击以切换源代码
调用父类方法
# File rss-0.3.1/lib/rss/maker/taxonomy.rb, line 9 def self.append_features(klass) super klass.def_classed_element("#{RSS::TAXO_PREFIX}_topics", "TaxonomyTopics") end
install_taxo_topics(klass) 点击以切换源代码
# File rss-0.3.1/lib/rss/maker/taxonomy.rb, line 16 def self.install_taxo_topics(klass) klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1) class TaxonomyTopics < TaxonomyTopicsBase def to_feed(feed, current) if current.respond_to?(:taxo_topics) topics = current.class::TaxonomyTopics.new bag = topics.Bag @resources.each do |resource| bag.lis << RDF::Bag::Li.new(resource) end current.taxo_topics = topics end end end EOC end