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
- #buffer(name) ⇒ Vedeu::Buffers::Buffer private
-
#cursor_visible?(name) ⇒ Boolean
private
Returns a boolean indicating whether the cursor is visible.
-
#hide(name = Vedeu.focus) ⇒ void
(also: #hide_group, #hide_interface)
Hides the named model, or without a name, the model with same name as the currently focussed interface.
-
#hide_cursor(name = Vedeu.focus) ⇒ void
Hide the cursor if visible.
-
#show(name = Vedeu.focus) ⇒ void
(also: #show_group, #show_interface)
Shows the named model, or without a name, the model with same name as the currently focussed interface.
-
#show_cursor(name = Vedeu.focus) ⇒ void
Show the cursor if not already visible.
-
#toggle(name = Vedeu.focus) ⇒ void
(also: #toggle_group, #toggle_interface)
Toggles the visibility of the named model, or without a name, the model with same name as the currently focussed interface.
-
#toggle_cursor(name = Vedeu.focus) ⇒ void
Toggle the cursor visibility.
Instance Method Details
#buffer(name) ⇒ Vedeu::Buffers::Buffer (private)
143 144 145 |
# File 'lib/vedeu/models/toggleable.rb', line 143 def buffer(name) Vedeu.buffers.by_name(name) end |
#cursor_visible?(name) ⇒ Boolean (private)
Returns a boolean indicating whether the cursor is visible.
138 139 140 |
# File 'lib/vedeu/models/toggleable.rb', line 138 def cursor_visible?(name) buffer(name).cursor_visible? end |
#hide(name = Vedeu.focus) ⇒ void Also known as: hide_group, hide_interface
This method returns an undefined value.
Hides the named model, or without a name, the model with same name as the currently focussed interface.
60 61 62 |
# File 'lib/vedeu/models/toggleable.rb', line 60 def hide(name = Vedeu.focus) repository.by_name(name).hide end |
#hide_cursor(name = Vedeu.focus) ⇒ void
This method returns an undefined value.
Hide the cursor if visible.
104 105 106 |
# File 'lib/vedeu/models/toggleable.rb', line 104 def hide_cursor(name = Vedeu.focus) hide(name) if cursor_visible?(name) end |
#show(name = Vedeu.focus) ⇒ void Also known as: show_group, show_interface
This method returns an undefined value.
Shows the named model, or without a name, the model with same name as the currently focussed interface.
75 76 77 |
# File 'lib/vedeu/models/toggleable.rb', line 75 def show(name = Vedeu.focus) repository.by_name(name).show end |
#show_cursor(name = Vedeu.focus) ⇒ void
This method returns an undefined value.
Show the cursor if not already visible.
116 117 118 |
# File 'lib/vedeu/models/toggleable.rb', line 116 def show_cursor(name = Vedeu.focus) show(name) if cursor_visible?(name) end |
#toggle(name = Vedeu.focus) ⇒ void Also known as: toggle_group, toggle_interface
This method returns an undefined value.
Toggles the visibility of the named model, or without a name, the model with same name as the currently focussed interface.
90 91 92 |
# File 'lib/vedeu/models/toggleable.rb', line 90 def toggle(name = Vedeu.focus) repository.by_name(name).toggle end |
#toggle_cursor(name = Vedeu.focus) ⇒ void
This method returns an undefined value.
Toggle the cursor visibility.
128 129 130 |
# File 'lib/vedeu/models/toggleable.rb', line 128 def toggle_cursor(name = Vedeu.focus) toggle(name) end |