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

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.

Examples:

Vedeu.hide_group(name)
Vedeu.hide_interface(name)


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.

Examples:

Vedeu.hide_cursor(name)

See Also:



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.

Examples:

Vedeu.show_group(name)
Vedeu.show_interface(name)


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.

Examples:

Vedeu.show_cursor(name)

See Also:



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.

Examples:

Vedeu.toggle_group(name)
Vedeu.toggle_interface(name)


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.

Examples:

Vedeu.toggle_cursor(name)

See Also:



128
129
130
# File 'lib/vedeu/models/toggleable.rb', line 128

def toggle_cursor(name = Vedeu.focus)
  toggle(name)
end