Class: Sesc::Exporter::Painter
- Inherits:
-
Object
- Object
- Sesc::Exporter::Painter
- Defined in:
- lib/sesc/exporter/painter.rb
Instance Attribute Summary collapse
-
#background ⇒ Object
Returns the value of attribute background.
-
#color ⇒ Object
Returns the value of attribute color.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #default ⇒ Object
-
#initialize(text, options = {}) ⇒ Painter
constructor
A new instance of Painter.
Constructor Details
#initialize(text, options = {}) ⇒ Painter
Returns a new instance of Painter.
8 9 10 11 12 |
# File 'lib/sesc/exporter/painter.rb', line 8 def initialize(text, = {}) self.text = text self.color = .fetch(:color, :light_white) self.background = .fetch(:background, :black) end |
Instance Attribute Details
#background ⇒ Object
Returns the value of attribute background.
6 7 8 |
# File 'lib/sesc/exporter/painter.rb', line 6 def background @background end |
#color ⇒ Object
Returns the value of attribute color.
6 7 8 |
# File 'lib/sesc/exporter/painter.rb', line 6 def color @color end |
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/sesc/exporter/painter.rb', line 6 def text @text end |
Instance Method Details
#default ⇒ Object
14 15 16 |
# File 'lib/sesc/exporter/painter.rb', line 14 def default text.colorize(color: color, background: background) end |