Sha256: fa5a98cb6641a64aedd476aae0b8a0dd8b63d74e5e69554c939593f793c8681d

Contents?: true

Size: 1.05 KB

Versions: 8

Compression:

Stored size: 1.05 KB

Contents

module Vedeu

  module Cursors

    # Control the visibility of the cursor for each interface/view.
    #
    # See {file:docs/cursors.md#interface_cursors}
    # See {file:docs/cursors.md#view_cursors}
    module DSL

      # Set the cursor visibility on an interface.
      #
      # @param value [Boolean] Any value other than nil or false will
      #   evaluate to true.
      # @return [Vedeu::Cursors::Cursor]
      def cursor(value = true)
        boolean = value ? true : false

        model.cursor_visible = boolean

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

      # Set the cursor to visible for the interface or view.
      #
      # @return [Vedeu::Cursors::Cursor]
      def cursor!
        cursor(true)
      end
      alias_method :show_cursor!, :cursor!

      # Set the cursor to invisible for the interface or view.
      #
      # @return [Vedeu::Cursors::Cursor]
      def no_cursor!
        cursor(false)
      end
      alias_method :hide_cursor!, :no_cursor!

    end # DSL

  end # Cursors

end # Vedeu

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.7.4 lib/vedeu/cursors/dsl.rb
vedeu-0.7.3 lib/vedeu/cursors/dsl.rb
vedeu-0.7.2 lib/vedeu/cursors/dsl.rb
vedeu-0.7.1 lib/vedeu/cursors/dsl.rb
vedeu-0.7.0 lib/vedeu/cursors/dsl.rb
vedeu-0.6.71 lib/vedeu/cursors/dsl.rb
vedeu-0.6.70 lib/vedeu/cursors/dsl.rb
vedeu-0.6.69 lib/vedeu/cursors/dsl.rb