Class: Statistrano::Log::DefaultLogger::Formatter
- Inherits:
-
Object
- Object
- Statistrano::Log::DefaultLogger::Formatter
- Defined in:
- lib/statistrano/log/default_logger.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#msgs ⇒ Object
readonly
Returns the value of attribute msgs.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(status, color, *msg) ⇒ Formatter
constructor
A new instance of Formatter.
- #output ⇒ Object
Constructor Details
#initialize(status, color, *msg) ⇒ Formatter
Returns a new instance of Formatter.
57 58 59 60 61 62 |
# File 'lib/statistrano/log/default_logger.rb', line 57 def initialize status, color, *msg @width = 14 @status = status.to_s @color = color @msgs = msg end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
55 56 57 |
# File 'lib/statistrano/log/default_logger.rb', line 55 def color @color end |
#msgs ⇒ Object (readonly)
Returns the value of attribute msgs.
55 56 57 |
# File 'lib/statistrano/log/default_logger.rb', line 55 def msgs @msgs end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
55 56 57 |
# File 'lib/statistrano/log/default_logger.rb', line 55 def status @status end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
55 56 57 |
# File 'lib/statistrano/log/default_logger.rb', line 55 def width @width end |
Instance Method Details
#output ⇒ Object
64 65 66 |
# File 'lib/statistrano/log/default_logger.rb', line 64 def output Rainbow(anchor).bright + padding + Rainbow(status).public_send(color) + end |