Class: Logsly::Colors
- Inherits:
-
Object
- Object
- Logsly::Colors
- Defined in:
- lib/logsly/colors.rb
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, &build) ⇒ Colors
constructor
A new instance of Colors.
- #to_scheme(*args) ⇒ Object
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
#build ⇒ Object (readonly)
Returns the value of attribute build.
13 14 15 |
# File 'lib/logsly/colors.rb', line 13 def build @build end |
#name ⇒ Object (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 |