Chris@909: module RFPDF Chris@909: module ActionController Chris@909: Chris@909: DEFAULT_RFPDF_OPTIONS = {:inline=>true} Chris@909: Chris@909: def self.included(base) Chris@909: base.extend ClassMethods Chris@909: end Chris@909: Chris@909: module ClassMethods Chris@909: def rfpdf(options) Chris@909: rfpdf_options = breakdown_rfpdf_options options Chris@909: write_inheritable_hash(:rfpdf, rfpdf_options) Chris@909: end Chris@909: Chris@909: private Chris@909: Chris@909: def breakdown_rfpdf_options(options) Chris@909: rfpdf_options = options.dup Chris@909: rfpdf_options Chris@909: end Chris@909: end Chris@909: Chris@909: def rfpdf(options) Chris@909: @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup Chris@909: @rfpdf_options.merge! options Chris@909: end Chris@909: Chris@909: Chris@909: private Chris@909: Chris@909: def compute_rfpdf_options Chris@909: @rfpdf_options ||= DEFAULT_RFPDF_OPTIONS.dup Chris@909: @rfpdf_options.merge!(self.class.read_inheritable_attribute(:rfpdf) || {}) {|k,o,n| o} Chris@909: @rfpdf_options Chris@909: end Chris@909: end Chris@909: end Chris@909: Chris@909: