Module: DelegatedPresenter::PresentsBeforeRendering::ClassMethods
- Defined in:
- lib/delegated_presenter/presents_before_rendering.rb
Instance Method Summary collapse
-
#presents(*instance_vars) ⇒ Object
(also: #present)
Sets up a presenter for instance variables.
- #presents_before_rendering ⇒ Object
Instance Method Details
#presents(instance_var1, instance_var2, [...]) ⇒ Object #presents(instance_var1, instance_var2, [...], options) ⇒ Object Also known as: present
Sets up a presenter for instance variables. By default it will try to determine the presenter but this can be overridden via the “with” option.
56 57 58 59 60 61 |
# File 'lib/delegated_presenter/presents_before_rendering.rb', line 56 def presents(*instance_vars) = instance_vars. instance_vars.each do |var| self.presents_before_rendering[var.to_sym] = end end |
#presents_before_rendering ⇒ Object
34 35 36 |
# File 'lib/delegated_presenter/presents_before_rendering.rb', line 34 def presents_before_rendering @presents_before_rendering ||= {} unless name == 'ActionController::Base' end |