Sha256: 7c2eacf7c86e380e2951e4eecb0ee2ac4f366080bb7b29eda468c547c698a6af

Contents?: true

Size: 312 Bytes

Versions: 7

Compression:

Stored size: 312 Bytes

Contents

module TP
  class Renderer
    attr_reader :text

    def initialize(text)
      @text = text
    end

    def render
      Screen.clear!

      return unless text

      print text unless testing?

      Screen.hide_cursor

      true
    end

    def testing?
      ENV['RUBY_ENV'] == 'test'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tp-0.6.2 lib/tp/renderer.rb
tp-0.6.2pre2 lib/tp/renderer.rb
tp-0.6.2pre1 lib/tp/renderer.rb
tp-0.6.1 lib/tp/renderer.rb
tp-0.6.0 lib/tp/renderer.rb
tp-0.5.1 lib/tp/renderer.rb
tp-0.5.0 lib/tp/renderer.rb