Module: Vedeu::Cursors::DSL

Included in:
DSL::View, Interfaces::DSL
Defined in:
lib/vedeu/cursors/dsl.rb

Overview

Control the visibility of the cursor for each interface/view.

Instance Method Summary collapse

Instance Method Details

#cursor(value = true) ⇒ Vedeu::Cursors::Cursor

Set the cursor visibility on an interface.

Examples:

Vedeu.interface :my_interface do
  cursor  true  # => show the cursor for this interface
  # or...
  cursor  :show # => both of these are equivalent to line
                #    above
  # or...
  cursor!       #
  # ...
end

Vedeu.interface :my_interface do
  cursor false # => hide the cursor for this interface
  # or...
  cursor nil   # => as above
  # ...
end

Vedeu.view :my_interface do
  cursor true # => Specify the visibility of the cursor when
              #    the view is rendered.
  # ...
end

Parameters:

  • value (Boolean) (defaults to: true)

    Any value other than nil or false will evaluate to true.

Returns:



40
41
42
43
44
45
46
# File 'lib/vedeu/cursors/dsl.rb', line 40

def cursor(value = true)
  boolean = value ? true : false

  model.cursor_visible = boolean

  Vedeu::Cursors::Cursor.store(name: model.name, visible: boolean)
end

#cursor!Vedeu::Cursors::Cursor Also known as: show_cursor!

Set the cursor to visible for the interface or view.



51
52
53
# File 'lib/vedeu/cursors/dsl.rb', line 51

def cursor!
  cursor(true)
end

#no_cursor!Vedeu::Cursors::Cursor Also known as: hide_cursor!

Set the cursor to invisible for the interface or view.



59
60
61
# File 'lib/vedeu/cursors/dsl.rb', line 59

def no_cursor!
  cursor(false)
end