Sha256: 105f715e2a761cbfb73b410c529f037a0479e37c943d167a6154cd9aedd2128b

Contents?: true

Size: 671 Bytes

Versions: 7

Compression:

Stored size: 671 Bytes

Contents

module Troo
  module DecoratorHelpers
    module ClassMethods
    end

    module InstanceMethods
      private

      def brackets(value)
        [
          '(', value, ')'
        ].join
      end

      def label(value, options = {})
        Troo::Formatter
          .highlight(value, label_defaults.merge!(options))
      end

      def error(message)
        Troo::Formatter.error(message) + "\n"
      end

      def label_defaults
        {
          colour:    Esc.yellow,
          underline: true
        }
      end
    end

    def self.included(receiver)
      receiver.extend(ClassMethods)
      receiver.send(:include, InstanceMethods)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
troo-0.0.15 lib/troo/helpers/decorator_helpers.rb
troo-0.0.14 lib/troo/helpers/decorator_helpers.rb
troo-0.0.13 lib/troo/helpers/decorator_helpers.rb
troo-0.0.12 lib/troo/helpers/decorator_helpers.rb
troo-0.0.11 lib/troo/helpers/decorator_helpers.rb
troo-0.0.10 lib/troo/helpers/decorator_helpers.rb
troo-0.0.9 lib/troo/helpers/decorator_helpers.rb