Module: RSS::Maker::TaxonomyTopicsModel

Defined Under Namespace

Classes: TaxonomyTopicsBase

Class Method Summary collapse

Class Method Details

.append_features(klass) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rss/maker/taxonomy.rb', line 8

def self.append_features(klass)
  super

  klass.add_need_initialize_variable("taxo_topics", "make_taxo_topics")
  klass.add_other_element("taxo_topics")
  klass.module_eval("    attr_reader :taxo_topics\n    def make_taxo_topics\n      self.class::TaxonomyTopics.new(@maker)\n    end\n      \n    def setup_taxo_topics(rss, current)\n      @taxo_topics.to_rss(rss, current)\n    end\n", __FILE__, __LINE__ + 1)
end

.install_taxo_topics(klass) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/rss/maker/taxonomy.rb', line 25

def self.install_taxo_topics(klass)
  klass.module_eval("    class TaxonomyTopics < TaxonomyTopicsBase\n      def to_rss(rss, current)\n        if current.respond_to?(:taxo_topics)\n          topics = current.class::TaxonomyTopics.new\n          bag = topics.Bag\n          @resources.each do |resource|\n            bag.lis << RDF::Bag::Li.new(resource)\n          end\n          current.taxo_topics = topics\n        end\n      end\n    end\n", *Utils.get_file_and_line_from_caller(1))
end