Sha256: 9d71ba0ddf43ff98f22edc9534df1b86cb0b8a266117b336c57c781aa9a299fb

Contents?: true

Size: 361 Bytes

Versions: 5

Compression:

Stored size: 361 Bytes

Contents

require 'rainbow/presenter'
require 'rainbow/null_presenter'

module Rainbow

  class Wrapper
    attr_accessor :enabled

    def initialize(enabled = true)
      @enabled = enabled
    end

    def wrap(string)
      if enabled
        Rainbow::Presenter.new(string.to_s)
      else
        Rainbow::NullPresenter.new(string.to_s)
      end
    end
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/wrapper.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rainbow-2.0.0/lib/rainbow/wrapper.rb
rainbow-2.0.0 lib/rainbow/wrapper.rb
rainbow-1.99.2 lib/rainbow/wrapper.rb
rainbow-1.99.1 lib/rainbow/wrapper.rb