Class: MeshChat::Display::Manager
- Inherits:
-
Object
- Object
- MeshChat::Display::Manager
- Defined in:
- lib/meshchat/display/manager.rb
Instance Attribute Summary collapse
-
#_logger ⇒ Object
Returns the value of attribute _logger.
-
#_ui ⇒ Object
Returns the value of attribute _ui.
Instance Method Summary collapse
-
#initialize(ui_klass) ⇒ Manager
constructor
A new instance of Manager.
- #present_message(message) ⇒ Object
Constructor Details
#initialize(ui_klass) ⇒ Manager
Returns a new instance of Manager.
23 24 25 26 |
# File 'lib/meshchat/display/manager.rb', line 23 def initialize(ui_klass) self._logger = Logger.new('debug.log') self._ui = ui_klass.new end |
Instance Attribute Details
#_logger ⇒ Object
Returns the value of attribute _logger.
18 19 20 |
# File 'lib/meshchat/display/manager.rb', line 18 def _logger @_logger end |
#_ui ⇒ Object
Returns the value of attribute _ui.
7 8 9 |
# File 'lib/meshchat/display/manager.rb', line 7 def _ui @_ui end |
Instance Method Details
#present_message(message) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/meshchat/display/manager.rb', line 28 def () result = .handle return unless result case .class.name when Message::Chat.name chat result Notify.show(summary: .sender_name, body: .) when Message::Whisper.name whisper result Notify.show(summary: .sender_name, body: .) when Message::PingReply.name, Message::Ping.name info result when Message::NodeList.name, Message::NodeListDiff.name, Message::NodeListHash.name # display nothing else add_line result end end |