Sha256: d5e00e541cbf747a81a851e2c17d1111eed1aafe10bf0d59ba410ec0204c853d

Contents?: true

Size: 884 Bytes

Versions: 1

Compression:

Stored size: 884 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 :blink         then Esc.blink
      when :blink_off     then Esc.blink_off
      when :bold          then Esc.bold
      when :bold_off      then Esc.bold_off
      when :clear         then Esc.clear
      when :hide_cursor   then Cursor.hide
      when :inverse       then Esc.inverse
      when :negative      then Esc.negative
      when :positive      then Esc.positive
      when :reset         then Esc.reset
      when :normal        then Esc.reset
      when :show_cursor   then Cursor.show
      when :underline     then Esc.underline
      when :underline_off then Esc.underline_off
      else
        ''
      end
    end

    private

    attr_reader :style
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vedeu-0.0.22 lib/vedeu/output/style.rb