class Pastel::Detached
A class representing detached color
Attributes
styles[R]
@api private
Public Class Methods
new(color, *styles)
click to toggle source
Initialize a detached object
@param [Pastel::Color] color
the color instance
@param [Array] styles
the styles to be applied
@api private
# File lib/pastel/detached.rb, line 18 def initialize(color, *styles) @color = color @styles = styles.dup freeze end
Public Instance Methods
call(*args)
click to toggle source
Decorate the values corresponding to styles
@example
@param [String] value
the stirng to decorate with styles
@return [String]
@api public
# File lib/pastel/detached.rb, line 34 def call(*args) value = args.join @color.decorate(value, *styles) end
Also aliased as: []
to_proc()
click to toggle source
@api public
# File lib/pastel/detached.rb, line 41 def to_proc self end