Class: ControllerHelper::ClassMethods::Partials
- Inherits:
-
Object
- Object
- ControllerHelper::ClassMethods::Partials
- Defined in:
- app/helpers/kit/controller_helper.rb
Instance Attribute Summary collapse
-
#controller_class ⇒ Object
readonly
Returns the value of attribute controller_class.
Instance Method Summary collapse
- #hide(name, options = {}) ⇒ Object
-
#initialize(controller_class) ⇒ Partials
constructor
A new instance of Partials.
- #show(name, options = {}) ⇒ Object
Constructor Details
#initialize(controller_class) ⇒ Partials
Returns a new instance of Partials.
51 52 53 |
# File 'app/helpers/kit/controller_helper.rb', line 51 def initialize controller_class @controller_class = controller_class end |
Instance Attribute Details
#controller_class ⇒ Object (readonly)
Returns the value of attribute controller_class.
49 50 51 |
# File 'app/helpers/kit/controller_helper.rb', line 49 def controller_class @controller_class end |
Instance Method Details
#hide(name, options = {}) ⇒ Object
61 62 63 64 65 |
# File 'app/helpers/kit/controller_helper.rb', line 61 def hide name, = {} controller_class.send :before, do |controller| controller.send(:_partials).delete name end end |
#show(name, options = {}) ⇒ Object
55 56 57 58 59 |
# File 'app/helpers/kit/controller_helper.rb', line 55 def show name, = {} controller_class.send :before, do |controller| controller.send(:_partials)[name] = true end end |