class Lecture::Slide::Center
Public Instance Methods
display()
click to toggle source
# File lib/lecture/slide/center.rb, line 6 def display content.each_line.with_index do |line, i| col = [1, 1 + (cols - line.chomp.uncolorize.length) / 2].max print_line(line, col, row + i) end end
Private Instance Methods
row()
click to toggle source
# File lib/lecture/slide/center.rb, line 16 def row @first_center_row ||= [1, 1 + (lines - content.count("\n")) / 2].max end