Sha256: a683e411b9313518c8ec96801a232062e0ff6b7dac81fc50477e6515a8966212

Contents?: true

Size: 1.11 KB

Versions: 19

Compression:

Stored size: 1.11 KB

Contents

module Vedeu

  # Provides escape sequence strings.
  #
  module EscapeSequences

    # Provides action related escape sequences.
    #
    module Actions

      extend self

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

19 entries across 19 versions & 1 rubygems

Version Path
vedeu-0.6.13 lib/vedeu/esc/actions.rb
vedeu-0.6.12 lib/vedeu/esc/actions.rb
vedeu-0.6.11 lib/vedeu/esc/actions.rb
vedeu-0.6.10 lib/vedeu/esc/actions.rb
vedeu-0.6.9 lib/vedeu/esc/actions.rb
vedeu-0.6.8 lib/vedeu/esc/actions.rb
vedeu-0.6.7 lib/vedeu/esc/actions.rb
vedeu-0.6.6 lib/vedeu/esc/actions.rb
vedeu-0.6.5 lib/vedeu/esc/actions.rb
vedeu-0.6.4 lib/vedeu/esc/actions.rb
vedeu-0.6.3 lib/vedeu/esc/actions.rb
vedeu-0.6.2 lib/vedeu/esc/actions.rb
vedeu-0.6.1 lib/vedeu/esc/actions.rb
vedeu-0.6.0 lib/vedeu/esc/actions.rb
vedeu-0.5.13 lib/vedeu/esc/actions.rb
vedeu-0.5.12 lib/vedeu/esc/actions.rb
vedeu-0.5.11 lib/vedeu/esc/actions.rb
vedeu-0.5.10 lib/vedeu/esc/actions.rb
vedeu-0.5.9 lib/vedeu/esc/actions.rb