Class: Twterm::Image::Bold

Inherits:
Twterm::Image show all
Defined in:
lib/twterm/image/bold.rb

Instance Method Summary collapse

Methods inherited from Twterm::Image

#!, #-, #at, blank_line, #bold, #brackets, checkbox, #color, #column, cursor, empty, #line, number, #parens, plural, remaining_resource, string, whitespace, #|

Constructor Details

#initialize(image) ⇒ Bold

Returns a new instance of Bold.



4
5
6
# File 'lib/twterm/image/bold.rb', line 4

def initialize(image)
  @image = image
end

Instance Method Details

#heightObject



8
9
10
# File 'lib/twterm/image/bold.rb', line 8

def height
  image.height
end

#render(window) ⇒ Object



12
13
14
15
16
# File 'lib/twterm/image/bold.rb', line 12

def render(window)
  window.attron(Curses::A_BOLD)
  image.at(line, column).render(window)
  window.attroff(Curses::A_BOLD)
end

#to_sObject



18
19
20
# File 'lib/twterm/image/bold.rb', line 18

def to_s
  "\e[1m#{image}\e[0m"
end

#widthObject



22
23
24
# File 'lib/twterm/image/bold.rb', line 22

def width
  image.width
end