diff .svn/pristine/a4/a42c48328809513f9f935c76bef600918b6947ba.svn-base @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.svn/pristine/a4/a42c48328809513f9f935c76bef600918b6947ba.svn-base	Fri Feb 24 19:09:32 2012 +0000
@@ -0,0 +1,40 @@
+module RFPDF
+  module ActionController
+
+    DEFAULT_RFPDF_OPTIONS = {:inline=>true}
+      
+      def self.included(base)
+        base.extend ClassMethods
+      end
+
+      module ClassMethods
+        def rfpdf(options)
+          rfpdf_options = breakdown_rfpdf_options options
+          write_inheritable_hash(:rfpdf, rfpdf_options)
+        end
+
+      private
+
+        def breakdown_rfpdf_options(options)
+          rfpdf_options = options.dup
+          rfpdf_options
+        end
+      end
+
+      def rfpdf(options)
+        @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup
+        @rfpdf_options.merge! options
+      end
+
+
+    private
+
+      def compute_rfpdf_options
+        @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup
+        @rfpdf_options.merge!(self.class.read_inheritable_attribute(:rfpdf) || {}) {|k,o,n| o}
+        @rfpdf_options
+      end
+  end
+end
+
+