Sha256: 9d40cdd2bc169848c8e6bec6d635c4ca27b678c4b8e8102dec72727eafa9eb3f
Contents?: true
Size: 897 Bytes
Versions: 9
Compression:
Stored size: 897 Bytes
Contents
# encoding: utf-8 require 'equatable' module Pastel # A class representing detached color class Detached include Equatable # Initialize a detached object # # @param [Pastel::Color] color # the color instance # @param [Array[Symbol]] styles # the styles to be applied # # @api private def initialize(color, *styles) @color = color @styles = styles.dup freeze end # Decorate the values corresponding to styles # # @example # # @param [String] value # the stirng to decorate with styles # # @return [String] # # @api public def call(*args) value = args.join @color.decorate(value, *styles) end alias_method :[], :call # @api public def to_proc self end private # @api private attr_reader :styles end # Detached end # Pastel
Version data entries
9 entries across 9 versions & 2 rubygems