Sha256: 54855038b26b57e197a57427ff08839cac7d73775ed667f029107d1ab6ab7b4b

Contents?: true

Size: 1.17 KB

Versions: 26

Compression:

Stored size: 1.17 KB

Contents

module Vedeu

  module EscapeSequences

    # Provides action related escape sequences.
    #
    module Actions

      extend self

      # @return [Hash<Symbol => String>]
      def characters
        {
          hide_cursor:     "\e[?25l".freeze,
          show_cursor:     "\e[?25h".freeze,
          cursor_position: "\e[6n".freeze,
          bg_reset:        "\e[49m".freeze,
          blink:           "\e[5m".freeze,
          blink_off:       "\e[25m".freeze,
          bold:            "\e[1m".freeze,
          bold_off:        "\e[22m".freeze,
          dim:             "\e[2m".freeze,
          fg_reset:        "\e[39m".freeze,
          negative:        "\e[7m".freeze,
          positive:        "\e[27m".freeze,
          reset:           "\e[0m".freeze,
          underline:       "\e[4m".freeze,
          underline_off:   "\e[24m".freeze,
        }
      end

      # @return [void]
      def setup!
        define_actions!
      end

      private

      # @return [void]
      def define_actions!
        characters.each { |key, code| define_method(key) { code } }
      end

    end # Actions

  end # EscapeSequences

  Vedeu::EscapeSequences::Actions.setup!

end # Vedeu

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
vedeu-0.6.51 lib/vedeu/esc/actions.rb
vedeu-0.6.50 lib/vedeu/esc/actions.rb
vedeu-0.6.49 lib/vedeu/esc/actions.rb
vedeu-0.6.48 lib/vedeu/esc/actions.rb
vedeu-0.6.47 lib/vedeu/esc/actions.rb
vedeu-0.6.46 lib/vedeu/esc/actions.rb
vedeu-0.6.45 lib/vedeu/esc/actions.rb
vedeu-0.6.44 lib/vedeu/esc/actions.rb
vedeu-0.6.43 lib/vedeu/esc/actions.rb
vedeu-0.6.42 lib/vedeu/esc/actions.rb
vedeu-0.6.41 lib/vedeu/esc/actions.rb
vedeu-0.6.40 lib/vedeu/esc/actions.rb
vedeu-0.6.39 lib/vedeu/esc/actions.rb
vedeu-0.6.38 lib/vedeu/esc/actions.rb
vedeu-0.6.37 lib/vedeu/esc/actions.rb
vedeu-0.6.36 lib/vedeu/esc/actions.rb
vedeu-0.6.35 lib/vedeu/esc/actions.rb
vedeu-0.6.34 lib/vedeu/esc/actions.rb
vedeu-0.6.33 lib/vedeu/esc/actions.rb
vedeu-0.6.32 lib/vedeu/esc/actions.rb