Sha256: 93c96e2753ebe7fefaf60e01c0bfd0373601475b85f2c3b3f3060dcc5336dd87

Contents?: true

Size: 669 Bytes

Versions: 7

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

module DevSuite
  module Utils
    module Color
      module Palette
        class Base
          # Define COLORS constant in subclass
          # Example:
          # COLORS = {
          #  red: 31,
          #  green: 32,
          #  yellow: 33,
          #  blue: 34,
          #  pink: 35,
          #  light_blue: 36,
          #  white: 37
          #  }
          #

          def colors
            unless self.class.const_defined?(:COLORS)
              raise NotImplementedError, "#{self.class} must define COLORS constant"
            end

            self.class::COLORS
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dev_suite-0.2.5 lib/dev_suite/utils/color/palette/base.rb
dev_suite-0.2.4 lib/dev_suite/utils/color/palette/base.rb
dev_suite-0.2.3 lib/dev_suite/utils/color/palette/base.rb
dev_suite-0.2.2 lib/dev_suite/utils/color/palette/base.rb
dev_suite-0.2.1 lib/dev_suite/utils/color/palette/base.rb
dev_suite-0.2.0 lib/dev_suite/utils/color/palette/base.rb
dev_suite-0.1.3 lib/dev_suite/utils/color/palette/base.rb