Sha256: 5912caa588b2a206132eba2f1a58a28f7e33a61ae914f6fe99f6eb8b857787e2

Contents?: true

Size: 601 Bytes

Versions: 3

Compression:

Stored size: 601 Bytes

Contents

module Vedeu
  class Style
    class << self
      def set(style)
        new(style).set
      end
    end

    def initialize(style)
      @style = style
    end

    def set
      case style
      when :bold        then Esc.bold
      when :clear       then Esc.clear
      when :hide_cursor then Cursor.hide
      when :inverse     then Esc.inverse
      when :reset       then Esc.reset
      when :normal      then Esc.reset
      when :show_cursor then Cursor.show
      when :underline   then Esc.underline
      else
        ''
      end
    end

    private

    attr_reader :style
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vedeu-0.0.19 lib/vedeu/output/style.rb
vedeu-0.0.18 lib/vedeu/output/style.rb
vedeu-0.0.17 lib/vedeu/output/style.rb