To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / .svn / pristine / a4 / a42c48328809513f9f935c76bef600918b6947ba.svn-base @ 1297:0a574315af3e

History | View | Annotate | Download (856 Bytes)

1
module RFPDF
2
  module ActionController
3

    
4
    DEFAULT_RFPDF_OPTIONS = {:inline=>true}
5
      
6
      def self.included(base)
7
        base.extend ClassMethods
8
      end
9

    
10
      module ClassMethods
11
        def rfpdf(options)
12
          rfpdf_options = breakdown_rfpdf_options options
13
          write_inheritable_hash(:rfpdf, rfpdf_options)
14
        end
15

    
16
      private
17

    
18
        def breakdown_rfpdf_options(options)
19
          rfpdf_options = options.dup
20
          rfpdf_options
21
        end
22
      end
23

    
24
      def rfpdf(options)
25
        @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup
26
        @rfpdf_options.merge! options
27
      end
28

    
29

    
30
    private
31

    
32
      def compute_rfpdf_options
33
        @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup
34
        @rfpdf_options.merge!(self.class.read_inheritable_attribute(:rfpdf) || {}) {|k,o,n| o}
35
        @rfpdf_options
36
      end
37
  end
38
end
39

    
40