Class: RubyRich::AppShell::StatusView
- Inherits:
-
Object
- Object
- RubyRich::AppShell::StatusView
- Defined in:
- lib/ruby_rich/app_shell.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(shell) ⇒ StatusView
constructor
A new instance of StatusView.
- #render ⇒ Object
Constructor Details
#initialize(shell) ⇒ StatusView
Returns a new instance of StatusView.
308 309 310 311 312 |
# File 'lib/ruby_rich/app_shell.rb', line 308 def initialize(shell) @shell = shell @width = 0 @height = 1 end |
Instance Attribute Details
#height ⇒ Object
Returns the value of attribute height.
306 307 308 |
# File 'lib/ruby_rich/app_shell.rb', line 306 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
306 307 308 |
# File 'lib/ruby_rich/app_shell.rb', line 306 def width @width end |
Instance Method Details
#render ⇒ Object
314 315 316 317 318 319 320 321 |
# File 'lib/ruby_rich/app_shell.rb', line 314 def render theme = @shell.theme focus = @shell.focus_manager.focused_name || :none progress = @shell.instance_variable_get(:@progress_text) status = progress || @shell.instance_variable_get(:@status) line = "#{theme.style(status, :accent)} #{theme.style('focus: ' + focus.to_s, :muted)} #{theme.style('Tab focus · Ctrl+C quit · /quit', :dim)}" [line] end |