Class: Logsly::Colors

Inherits:
Object
  • Object
show all
Defined in:
lib/logsly/colors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &build) ⇒ Colors

Returns a new instance of Colors.



15
16
17
# File 'lib/logsly/colors.rb', line 15

def initialize(name, &build)
  @name, @build = name, build
end

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



13
14
15
# File 'lib/logsly/colors.rb', line 13

def build
  @build
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/logsly/colors.rb', line 13

def name
  @name
end

Instance Method Details

#to_scheme(*args) ⇒ Object



19
20
21
22
23
# File 'lib/logsly/colors.rb', line 19

def to_scheme(*args)
  "#{@name}-#{args.map{|a| a.object_id}.join('-')}".tap do |scheme_name|
    Logging.color_scheme(scheme_name, ColorsData.new(*args, &@build).to_scheme_opts)
  end
end