Class: Kward::PromptInterface::Banner
- Inherits:
-
Object
- Object
- Kward::PromptInterface::Banner
- Defined in:
- lib/kward/prompt_interface/banner.rb
Overview
Startup banner rendering data and helpers for the prompt interface.
Constant Summary collapse
- MESSAGE =
"State your business.".freeze
Instance Method Summary collapse
-
#initialize(message:, screen_height:, minimum_composer_rows: 3) ⇒ Banner
constructor
A new instance of Banner.
- #logo_rows(_width) ⇒ Object
- #rows(width, message: nil) ⇒ Object
Constructor Details
#initialize(message:, screen_height:, minimum_composer_rows: 3) ⇒ Banner
Returns a new instance of Banner.
9 10 11 12 13 |
# File 'lib/kward/prompt_interface/banner.rb', line 9 def initialize(message:, screen_height:, minimum_composer_rows: 3) @message = .to_s @screen_height = screen_height @minimum_composer_rows = minimum_composer_rows end |
Instance Method Details
#logo_rows(_width) ⇒ Object
22 23 24 |
# File 'lib/kward/prompt_interface/banner.rb', line 22 def logo_rows(_width) [] end |
#rows(width, message: nil) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/kward/prompt_interface/banner.rb', line 15 def rows(width, message: nil) content = .nil? ? @message : .to_s return [] if content.empty? || <= 0 visible_lines(content) + [""] end |