Mercurial > hg > soundsoftware-site
annotate .svn/pristine/a4/a42c48328809513f9f935c76bef600918b6947ba.svn-base @ 1295:622f24f53b42 redmine-2.3
Update to Redmine SVN revision 11972 on 2.3-stable branch
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:02:21 +0100 |
parents | cbb26bc654de |
children |
rev | line source |
---|---|
Chris@909 | 1 module RFPDF |
Chris@909 | 2 module ActionController |
Chris@909 | 3 |
Chris@909 | 4 DEFAULT_RFPDF_OPTIONS = {:inline=>true} |
Chris@909 | 5 |
Chris@909 | 6 def self.included(base) |
Chris@909 | 7 base.extend ClassMethods |
Chris@909 | 8 end |
Chris@909 | 9 |
Chris@909 | 10 module ClassMethods |
Chris@909 | 11 def rfpdf(options) |
Chris@909 | 12 rfpdf_options = breakdown_rfpdf_options options |
Chris@909 | 13 write_inheritable_hash(:rfpdf, rfpdf_options) |
Chris@909 | 14 end |
Chris@909 | 15 |
Chris@909 | 16 private |
Chris@909 | 17 |
Chris@909 | 18 def breakdown_rfpdf_options(options) |
Chris@909 | 19 rfpdf_options = options.dup |
Chris@909 | 20 rfpdf_options |
Chris@909 | 21 end |
Chris@909 | 22 end |
Chris@909 | 23 |
Chris@909 | 24 def rfpdf(options) |
Chris@909 | 25 @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup |
Chris@909 | 26 @rfpdf_options.merge! options |
Chris@909 | 27 end |
Chris@909 | 28 |
Chris@909 | 29 |
Chris@909 | 30 private |
Chris@909 | 31 |
Chris@909 | 32 def compute_rfpdf_options |
Chris@909 | 33 @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup |
Chris@909 | 34 @rfpdf_options.merge!(self.class.read_inheritable_attribute(:rfpdf) || {}) {|k,o,n| o} |
Chris@909 | 35 @rfpdf_options |
Chris@909 | 36 end |
Chris@909 | 37 end |
Chris@909 | 38 end |
Chris@909 | 39 |
Chris@909 | 40 |