~ubuntu-branches/ubuntu/trusty/ruby1.9/trusty

« back to all changes in this revision

Viewing changes to lib/rss/maker/slash.rb

  • Committer: Bazaar Package Importer
  • Author(s): Stephan Hermann
  • Date: 2008-01-24 11:42:29 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20080124114229-jw2f87rdxlq6gp11
Tags: 1.9.0.0-2ubuntu1
* Merge from debian unstable, remaining changes:
  - Robustify check for target_os, fixing build failure on lpia.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'rss/slash'
 
2
require 'rss/maker/1.0'
 
3
 
 
4
module RSS
 
5
  module Maker
 
6
    module SlashModel
 
7
      def self.append_features(klass)
 
8
        super
 
9
 
 
10
        ::RSS::SlashModel::ELEMENT_INFOS.each do |name, type|
 
11
          full_name = "#{RSS::SLASH_PREFIX}_#{name}"
 
12
          case type
 
13
          when :csv_integer
 
14
            klass.def_csv_element(full_name, :integer)
 
15
          else
 
16
            klass.def_other_element(full_name)
 
17
          end
 
18
        end
 
19
 
 
20
        klass.module_eval do
 
21
          alias_method(:slash_hit_parades, :slash_hit_parade)
 
22
          alias_method(:slash_hit_parades=, :slash_hit_parade=)
 
23
        end
 
24
      end
 
25
    end
 
26
 
 
27
    class ItemsBase
 
28
      class ItemBase
 
29
        include SlashModel
 
30
      end
 
31
    end
 
32
  end
 
33
end