class Dumon::Ui
This class represents Dumon’s user interface.
Attributes
omanager[R]
Output manager used to manipulate the output.
Public Class Methods
new()
click to toggle source
Constructor.
# File lib/dumon/ui.rb, line 16 def initialize @omanager = new_omanager Dumon::logger.debug "Used output manager: #{omanager.class.name}" end
Public Instance Methods
about()
click to toggle source
Provides information about the app.
# 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)
click to toggle source
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>
# File lib/dumon/ui.rb, line 30 def new_omanager(with=Dumon::XrandrManager) with.new end
quit()
click to toggle source
Quits the application.
# File lib/dumon/ui.rb, line 43 def quit raise NotImplementedError, 'this should be overridden by concrete sub-class' end
render()
click to toggle source
Renders the UI. Abstract method to be overridden by concrete sub-class.
# File lib/dumon/ui.rb, line 37 def render raise NotImplementedError, 'this should be overridden by concrete sub-class' end