Class: Daigaku::Views::Splash
- Inherits:
-
Object
- Object
- Daigaku::Views::Splash
- Includes:
- Daigaku::Views
- Defined in:
- lib/daigaku/views/splash.rb
Instance Method Summary collapse
-
#initialize ⇒ Splash
constructor
A new instance of Splash.
- #ruby_ascii_art ⇒ Object
Constructor Details
#initialize ⇒ Splash
Returns a new instance of Splash.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/daigaku/views/splash.rb', line 7 def initialize title = "DAIGAKU" subtitle = "Learning the Ruby programming language dead easy." panel = default_window lines.times do |line| panel.setpos(line, 0) panel.red(' ' * cols, Curses::A_STANDOUT) end panel.setpos((lines / 4), (cols - title.length) / 2) panel.red(title, Curses::A_STANDOUT) panel.refresh sleep 0.5 ruby_ascii_art.each_with_index do |line, index| panel.setpos(lines / 4 + 2 + index, (cols - line.length) / 2) panel.red(line, Curses::A_STANDOUT) sleep 0.06 panel.refresh end panel.setpos(lines / 4 + 11, (cols - subtitle.length) / 2) subtitle.chars do |char| panel.red(char, Curses::A_STANDOUT) panel.refresh sleep 0.02 end sleep 2.5 close_screen end |
Instance Method Details
#ruby_ascii_art ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/daigaku/views/splash.rb', line 44 def ruby_ascii_art [ " ___________ ", " /.\\ /.\\ /.\\ ", "/___\\/___\\/___\\", " \\ \\ . / . / ", " \\ \\ ./ ./ ", " \\\\ / / ", " \\./ " ] end |