Class: Dumon::Ui
- Inherits:
-
Object
- Object
- Dumon::Ui
- Defined in:
- lib/dumon/ui.rb
Overview
This class represents Dumon’s user interface.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#omanager ⇒ Object
readonly
Output manager used to manipulate the output.
Instance Method Summary collapse
-
#about ⇒ Object
Provides information about the app.
-
#initialize ⇒ Ui
constructor
Constructor.
-
#new_omanager(with = Dumon::XrandrManager) ⇒ Object
Factory method to create a new object of output manager.<p/> Can be used as Dependency Injection (DI) entry point: you can reopen Dumon:Ui and redefine ‘new_omanager’ if you implement a new output manager.
-
#quit ⇒ Object
Quits the application.
-
#render ⇒ Object
Renders the UI.
Constructor Details
Instance Attribute Details
#omanager ⇒ Object (readonly)
Output manager used to manipulate the output.
12 13 14 |
# File 'lib/dumon/ui.rb', line 12 def omanager @omanager end |
Instance Method Details
#about ⇒ Object
Provides information about the app.
49 50 51 |
# File 'lib/dumon/ui.rb', line 49 def about raise NotImplementedError, 'this should be overridden by concrete sub-class' end |
#new_omanager(with = Dumon::XrandrManager) ⇒ Object
Factory method to create a new object of output manager.<p/> Can be used as Dependency Injection (DI) entry point: you can reopen Dumon:Ui and redefine ‘new_omanager’ if you implement a new output manager. <pre> class Dumon::Ui
def new_omanager; Dumon::XyManager.new; end
end </pre>
30 31 32 |
# File 'lib/dumon/ui.rb', line 30 def new_omanager(with=Dumon::XrandrManager) with.new end |
#quit ⇒ Object
Quits the application.
43 44 45 |
# File 'lib/dumon/ui.rb', line 43 def quit raise NotImplementedError, 'this should be overridden by concrete sub-class' end |
#render ⇒ Object
Renders the UI. Abstract method to be overridden by concrete sub-class.
37 38 39 |
# File 'lib/dumon/ui.rb', line 37 def render raise NotImplementedError, 'this should be overridden by concrete sub-class' end |