Class: MotdForge::Banner

Inherits:
Object
  • Object
show all
Defined in:
lib/motd_forge/banner.rb

Overview

Composes the final banner: a big title (via figlet if it's installed, else a plain bordered header), system stats, and a random quote.

Instance Method Summary collapse

Constructor Details

#initialize(title:, stats: SystemStats.capture, quote: Quotes.new.pick) ⇒ Banner

Returns a new instance of Banner.



9
10
11
12
13
# File 'lib/motd_forge/banner.rb', line 9

def initialize(title:, stats: SystemStats.capture, quote: Quotes.new.pick)
  @title = title
  @stats = stats
  @quote = quote
end

Instance Method Details

#renderObject



15
16
17
# File 'lib/motd_forge/banner.rb', line 15

def render
  [render_title, render_stats, render_quote].compact.join("\n")
end