Sha256: d3c7b89afaea83b07ae3e04017bceabdc7ea5778c9e59ece393e0ccbef4f7553

Contents?: true

Size: 881 Bytes

Versions: 3

Compression:

Stored size: 881 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 :negative      then Esc.negative
      when :positive      then Esc.positive
      when :reset         then Esc.reset
      when :normal        then Esc.normal
      when :dim           then Esc.dim
      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

3 entries across 3 versions & 1 rubygems

Version Path
vedeu-0.0.25 lib/vedeu/output/style.rb
vedeu-0.0.24 lib/vedeu/output/style.rb
vedeu-0.0.23 lib/vedeu/output/style.rb