Module: Prawnto::ActionControllerMixin::ClassMethods

Defined in:
lib/prawnto/action_controller_mixin.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(cls) ⇒ Object



13
14
15
16
# File 'lib/prawnto/action_controller_mixin.rb', line 13

def self.extended(cls)
  cls.send(:class_attribute, :prawn_options)
  cls.send(:class_attribute, :prawnto_options)
end

Instance Method Details

#prawn_optionsObject



22
23
24
# File 'lib/prawnto/action_controller_mixin.rb', line 22

def prawn_options
  read_inheritable_attribute(:prawn_options)
end

#prawn_options=(options) ⇒ Object



18
19
20
# File 'lib/prawnto/action_controller_mixin.rb', line 18

def prawn_options=(options)
  write_inheritable_hash(:prawn_options, options)
end

#prawnto(options) ⇒ Object



35
36
37
38
39
# File 'lib/prawnto/action_controller_mixin.rb', line 35

def prawnto(options)
  prawn_options, prawnto_options = breakdown_prawnto_options options
  self.prawn_options = prawn_options
  self.prawnto_options = prawnto_options
end

#prawnto_optionsObject



30
31
32
# File 'lib/prawnto/action_controller_mixin.rb', line 30

def prawnto_options
  read_inheritable_attribute(:prawnto_options)
end

#prawnto_options=(options) ⇒ Object



26
27
28
# File 'lib/prawnto/action_controller_mixin.rb', line 26

def prawnto_options=(options)
  write_inheritable_hash(:prawnto_options, options)
end