summaryrefslogtreecommitdiff
path: root/lib/rss/maker/syndication.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rss/maker/syndication.rb')
-rw-r--r--lib/rss/maker/syndication.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/rss/maker/syndication.rb b/lib/rss/maker/syndication.rb
new file mode 100644
index 0000000000..ad846413ae
--- /dev/null
+++ b/lib/rss/maker/syndication.rb
@@ -0,0 +1,27 @@
+require 'rss/syndication'
+require 'rss/maker/1.0'
+
+module RSS
+ module Maker
+ module SyndicationModel
+ def self.append_features(klass)
+ super
+
+ ::RSS::SyndicationModel::ELEMENTS.each do |element|
+ klass.add_need_initialize_variable(element)
+ klass.add_other_element(element)
+ klass.__send__(:attr_accessor, element)
+ klass.module_eval(<<-EOC, __FILE__, __LINE__)
+ def setup_#{element}(rss, current)
+ current.#{element} = @#{element} if @#{element}
+ end
+EOC
+ end
+ end
+ end
+
+ class RSS10
+ class Channel; include SyndicationModel; end
+ end
+ end
+end