Sha256: 7eb0f2f5a9289b908ab6bf49c810be754f8c00829544166da5cdc98006c04816

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

module Vedeu

  module DSL

    # Provides DSL methods for Vedeu::Cursors::Cursor objects.
    #
    # @api public
    #
    module Cursors

      # 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)
        model.cursor_visible = Vedeu::Boolean.coerce(value)

        Vedeu::Cursors::Cursor.store(name:    name,
                                     visible: Vedeu::Boolean.coerce(value))
      end

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

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

    end # Cursors

  end # DSL

end # Vedeu

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
vedeu-0.8.32 lib/vedeu/dsl/cursors.rb
vedeu-0.8.31 lib/vedeu/dsl/cursors.rb
vedeu-0.8.30 lib/vedeu/dsl/cursors.rb
vedeu-0.8.29 lib/vedeu/dsl/cursors.rb
vedeu-0.8.28 lib/vedeu/dsl/cursors.rb
vedeu-0.8.27 lib/vedeu/dsl/cursors.rb
vedeu-0.8.26 lib/vedeu/dsl/cursors.rb
vedeu-0.8.25 lib/vedeu/dsl/cursors.rb