Class: Fatty::AlertSession
- Defined in:
- lib/fatty/session/alert_session.rb
Overview
A pinned, non-interactive overlay session responsible for rendering alerts.
It is intentionally dumb:
- Terminal does not special-case alerts
- other sessions emit commands like: [:send, :alert, :show, { level:, message: }] [:send, :alert, :clear, {}]
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
Attributes inherited from Session
#counter, #keymap, #terminal, #views
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize ⇒ AlertSession
constructor
A new instance of AlertSession.
Methods inherited from Session
#add_view, #close, #handle_action, #handle_resize, #init, #inspect, #keymap_contexts, #persist!, #resolve_action, #tick, #update, #view
Methods included from Actionable
Constructor Details
#initialize ⇒ AlertSession
Returns a new instance of AlertSession.
14 15 16 17 |
# File 'lib/fatty/session/alert_session.rb', line 14 def initialize super(views: [Fatty::AlertView.new(z: 1_000)]) @current = nil end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
12 13 14 |
# File 'lib/fatty/session/alert_session.rb', line 12 def current @current end |
Instance Method Details
#id ⇒ Object
19 20 21 |
# File 'lib/fatty/session/alert_session.rb', line 19 def id :alert end |