Class: WindowTerminal::ColoredText
Overview
A subclass of Text for colored window text.
Instance Attribute Summary
Attributes inherited from Text
Instance Method Summary collapse
-
#initialize(orientation, text, y, color = :green) ⇒ ColoredText
constructor
Initializes a ColoredText object.
-
#set_text(text) ⇒ Object
Sets text while taking into account colorization.
-
#to_s ⇒ Object
Makes to_s return something more meaningful.
Methods inherited from Text
Constructor Details
#initialize(orientation, text, y, color = :green) ⇒ ColoredText
Initializes a ColoredText object.
215 216 217 218 219 |
# File 'lib/accu-window.rb', line 215 def initialize(orientation,text,y,color=:green) @color = color text = colorize(text) super(orientation,text,y) end |
Instance Method Details
#set_text(text) ⇒ Object
Sets text while taking into account colorization.
239 240 241 |
# File 'lib/accu-window.rb', line 239 def set_text(text) super(colorize(text)) end |
#to_s ⇒ Object
Makes to_s return something more meaningful.
245 246 247 |
# File 'lib/accu-window.rb', line 245 def to_s "<ColoredText @orientation=#{@orientation.to_s}, @y=#{@y}, @color=#{@color.to_s} >" end |