Class: Sesc::Exporter::Painter

Inherits:
Object
  • Object
show all
Defined in:
lib/sesc/exporter/painter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, options = {})
  self.text       = text
  self.color      = options.fetch(:color, :light_white)
  self.background = options.fetch(:background, :black)
end

Instance Attribute Details

#backgroundObject

Returns the value of attribute background.



6
7
8
# File 'lib/sesc/exporter/painter.rb', line 6

def background
  @background
end

#colorObject

Returns the value of attribute color.



6
7
8
# File 'lib/sesc/exporter/painter.rb', line 6

def color
  @color
end

#textObject

Returns the value of attribute text.



6
7
8
# File 'lib/sesc/exporter/painter.rb', line 6

def text
  @text
end

Instance Method Details

#defaultObject



14
15
16
# File 'lib/sesc/exporter/painter.rb', line 14

def default
  text.colorize(color: color, background: background)
end