Module: Vedeu::Toggleable::ClassMethods
- Defined in:
- lib/vedeu/models/toggleable.rb
Overview
Provide class methods to models to allow the visibility to be changed.
Instance Method Summary collapse
-
#hide(name = nil) ⇒ void
(also: #hide_cursor, #hide_group, #hide_interface)
Hides the model.
-
#model_by_name(klass, name = nil) ⇒ void
private
Fetch the model by name.
-
#show(name = nil) ⇒ void
(also: #show_cursor, #show_group, #show_interface)
Shows the model.
-
#toggle(name = nil) ⇒ void
(also: #toggle_cursor, #toggle_group, #toggle_interface)
Toggles the visibility of the model.
Instance Method Details
#hide(name = nil) ⇒ void Also known as: hide_cursor, hide_group, hide_interface
This method returns an undefined value.
Hides the model.
56 57 58 |
# File 'lib/vedeu/models/toggleable.rb', line 56 def hide(name = nil) model_by_name(repository, name).hide end |
#model_by_name(klass, name = nil) ⇒ void (private)
This method returns an undefined value.
Fetch the model by name.
92 93 94 |
# File 'lib/vedeu/models/toggleable.rb', line 92 def model_by_name(klass, name = nil) klass.by_name(name || Vedeu.focus) end |
#show(name = nil) ⇒ void Also known as: show_cursor, show_group, show_interface
This method returns an undefined value.
Shows the model.
67 68 69 |
# File 'lib/vedeu/models/toggleable.rb', line 67 def show(name = nil) model_by_name(repository, name).show end |
#toggle(name = nil) ⇒ void Also known as: toggle_cursor, toggle_group, toggle_interface
This method returns an undefined value.
Toggles the visibility of the model.
78 79 80 |
# File 'lib/vedeu/models/toggleable.rb', line 78 def toggle(name = nil) model_by_name(repository, name).toggle end |