Module: Vedeu::Toggleable::SingletonMethods
- Defined in:
- lib/vedeu/models/toggleable.rb
Overview
Provide additional behaviour as singleton methods to the including class or module.
Instance Method Summary collapse
-
#buffer(name) ⇒ Vedeu::Buffers::Buffer
private
Returns the named buffer from the buffer repository.
-
#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)
Returns the named buffer from the buffer repository.
142 143 144 |
# File 'lib/vedeu/models/toggleable.rb', line 142 def buffer(name) Vedeu.buffers.by_name(name) end |
#cursor_visible?(name) ⇒ Boolean (private)
Returns a boolean indicating whether the cursor is visible.
136 137 138 |
# File 'lib/vedeu/models/toggleable.rb', line 136 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.
58 59 60 |
# File 'lib/vedeu/models/toggleable.rb', line 58 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.
102 103 104 |
# File 'lib/vedeu/models/toggleable.rb', line 102 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.
73 74 75 |
# File 'lib/vedeu/models/toggleable.rb', line 73 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.
114 115 116 |
# File 'lib/vedeu/models/toggleable.rb', line 114 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.
88 89 90 |
# File 'lib/vedeu/models/toggleable.rb', line 88 def toggle(name = Vedeu.focus) repository.by_name(name).toggle end |