Class: MotdForge::Quotes

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

Overview

Picks a random quote to print under the banner. Ships with a small built-in set and can be extended with a plain-text file, one quote per line.

Constant Summary collapse

DEFAULT =
[
  "It's not a bug, it's an undocumented feature.",
  "There's no place like 127.0.0.1.",
  "Rebooting the router fixes everything, eventually.",
  "In case of fire: git commit, git push, then evacuate.",
  "99 little bugs in the code, 99 little bugs...",
  "The cloud is just someone else's computer. This one's yours."
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(file: nil) ⇒ Quotes

Returns a new instance of Quotes.



16
17
18
# File 'lib/motd_forge/quotes.rb', line 16

def initialize(file: nil)
  @file = file
end

Instance Method Details

#pickObject



20
21
22
# File 'lib/motd_forge/quotes.rb', line 20

def pick
  pool.sample
end