Sha256: 9af65162f918223842e2f26da409c912aa8d41fbbfc583afe8733818c2c7e382

Contents?: true

Size: 998 Bytes

Versions: 17

Compression:

Stored size: 998 Bytes

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)
        boolean = value ? true : false

        model.cursor_visible = boolean

        Vedeu::Cursors::Cursor.store(name: name, visible: boolean)
      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

17 entries across 17 versions & 1 rubygems

Version Path
vedeu-0.8.24 lib/vedeu/dsl/cursors.rb
vedeu-0.8.23 lib/vedeu/dsl/cursors.rb
vedeu-0.8.22 lib/vedeu/dsl/cursors.rb
vedeu-0.8.21 lib/vedeu/dsl/cursors.rb
vedeu-0.8.20 lib/vedeu/dsl/cursors.rb
vedeu-0.8.19 lib/vedeu/dsl/cursors.rb
vedeu-0.8.18 lib/vedeu/dsl/cursors.rb
vedeu-0.8.17 lib/vedeu/dsl/cursors.rb
vedeu-0.8.16 lib/vedeu/dsl/cursors.rb
vedeu-0.8.15 lib/vedeu/dsl/cursors.rb
vedeu-0.8.14 lib/vedeu/dsl/cursors.rb
vedeu-0.8.13 lib/vedeu/dsl/cursors.rb
vedeu-0.8.12 lib/vedeu/dsl/cursors.rb
vedeu-0.8.10 lib/vedeu/dsl/cursors.rb
vedeu-0.8.9 lib/vedeu/dsl/cursors.rb
vedeu-0.8.8 lib/vedeu/dsl/cursors.rb
vedeu-0.8.7 lib/vedeu/dsl/cursors.rb