Sha256: a67ccc898c8f62e9910c4f0d96300ac1b1df6b0d7ae5cad99d91c9431f72f6a4

Contents?: true

Size: 775 Bytes

Versions: 2

Compression:

Stored size: 775 Bytes

Contents

# frozen_string_literal: true

module RubyJard
  module Commands
    ##
    # Helper to dedocrate command output
    module ColorHelpers
      def special(content)
        color_decorator.decorate(:text_special, content)
      end

      def secondary(content)
        color_decorator.decorate(:text_primary, content)
      end

      def highlight(content)
        color_decorator.decorate(:text_highlighted, content)
      end

      def pick_color_scheme
        (
          RubyJard::ColorSchemes[RubyJard.config.color_scheme] ||
          RubyJard::ColorSchemes[RubyJard::Config::DEFAULT_COLOR_SCHEME]
        ).new
      end

      def color_decorator
        @color_decorator ||= RubyJard::Decorators::ColorDecorator.new(pick_color_scheme)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby_jard-0.3.1 lib/ruby_jard/commands/color_helpers.rb
ruby_jard-0.3.0 lib/ruby_jard/commands/color_helpers.rb