Sha256: e76a11279f2856bc4290134ae28cf2e61ad08727a30ba5870d7a3e9234258527

Contents?: true

Size: 1.07 KB

Versions: 24

Compression:

Stored size: 1.07 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!
        characters.each { |key, code| define_method(key) { code } }
      end

    end # Actions

  end # EscapeSequences

  Vedeu::EscapeSequences::Actions.setup!

end # Vedeu

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
vedeu-0.7.4 lib/vedeu/esc/actions.rb
vedeu-0.7.3 lib/vedeu/esc/actions.rb
vedeu-0.7.2 lib/vedeu/esc/actions.rb
vedeu-0.7.1 lib/vedeu/esc/actions.rb
vedeu-0.7.0 lib/vedeu/esc/actions.rb
vedeu-0.6.71 lib/vedeu/esc/actions.rb
vedeu-0.6.70 lib/vedeu/esc/actions.rb
vedeu-0.6.69 lib/vedeu/esc/actions.rb
vedeu-0.6.68 lib/vedeu/esc/actions.rb
vedeu-0.6.67 lib/vedeu/esc/actions.rb
vedeu-0.6.66 lib/vedeu/esc/actions.rb
vedeu-0.6.65 lib/vedeu/esc/actions.rb
vedeu-0.6.64 lib/vedeu/esc/actions.rb
vedeu-0.6.63 lib/vedeu/esc/actions.rb
vedeu-0.6.62 lib/vedeu/esc/actions.rb
vedeu-0.6.61 lib/vedeu/esc/actions.rb
vedeu-0.6.60 lib/vedeu/esc/actions.rb
vedeu-0.6.59 lib/vedeu/esc/actions.rb
vedeu-0.6.58 lib/vedeu/esc/actions.rb
vedeu-0.6.57 lib/vedeu/esc/actions.rb