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.



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

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

Instance Attribute Details

#buildObject (readonly)

Returns the value of attribute build.



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

def build
  @build
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#to_scheme(*args) ⇒ Object



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

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