Class: ControllerHelper::Partials
- Inherits:
-
Object
- Object
- ControllerHelper::Partials
- Defined in:
- app/helpers/kit/controller_helper.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
- #hide(name) ⇒ Object
- #hide?(name) ⇒ Boolean
-
#initialize(controller) ⇒ Partials
constructor
A new instance of Partials.
- #show(name) ⇒ Object
- #show?(name) ⇒ Boolean
Constructor Details
#initialize(controller) ⇒ Partials
Returns a new instance of Partials.
9 10 11 |
# File 'app/helpers/kit/controller_helper.rb', line 9 def initialize controller @controller = controller end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
7 8 9 |
# File 'app/helpers/kit/controller_helper.rb', line 7 def controller @controller end |
Instance Method Details
#hide(name) ⇒ Object
25 26 27 |
# File 'app/helpers/kit/controller_helper.rb', line 25 def hide name partials.delete name end |
#hide?(name) ⇒ Boolean
17 18 19 |
# File 'app/helpers/kit/controller_helper.rb', line 17 def hide? name !show?(name) end |
#show(name) ⇒ Object
21 22 23 |
# File 'app/helpers/kit/controller_helper.rb', line 21 def show name partials[name] = true end |
#show?(name) ⇒ Boolean
13 14 15 |
# File 'app/helpers/kit/controller_helper.rb', line 13 def show? name partials.include? name end |