1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-25 18:01:14 +00:00
redmine/vendor/plugins/rfpdf/lib/rfpdf/action_controller.rb
Toshi MARUYAMA 22e8d9b949 PDF: update rfpdf (#61).
https://github.com/edwinmoss/rfpdf
revision a04724b4af95c15a99675b34e353c15534d20411

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5247 e93f8b46-1217-0410-a6f0-8f06a7374b81
2011-03-30 03:23:54 +00:00

41 lines
856 B
Ruby

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