Class: SearchKit::Messages::Messaging::Message
- Inherits:
-
Object
- Object
- SearchKit::Messages::Messaging::Message
- Defined in:
- lib/search_kit/messages/messaging.rb
Overview
Most of the logic for the Messaging module exists in this (not so) private class. This lets more complex handling of message logic enter into the module gracefully, for example silence or logging level.
Defined Under Namespace
Classes: Prefixed
Instance Attribute Summary collapse
-
#cli ⇒ Object
readonly
Returns the value of attribute cli.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(message) ⇒ Message
constructor
A new instance of Message.
- #password_prompt ⇒ Object
- #prompt ⇒ Object
- #warn ⇒ Object
Constructor Details
#initialize(message) ⇒ Message
Returns a new instance of Message.
35 36 37 38 |
# File 'lib/search_kit/messages/messaging.rb', line 35 def initialize() @message = @cli = HighLine.new end |
Instance Attribute Details
#cli ⇒ Object (readonly)
Returns the value of attribute cli.
33 34 35 |
# File 'lib/search_kit/messages/messaging.rb', line 33 def cli @cli end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
33 34 35 |
# File 'lib/search_kit/messages/messaging.rb', line 33 def @message end |
Instance Method Details
#info ⇒ Object
45 46 47 48 |
# File 'lib/search_kit/messages/messaging.rb', line 45 def info Kernel.puts(Prefixed(.ansi(:cyan))) if SearchKit.config.verbose SearchKit.logger.info end |
#password_prompt ⇒ Object
54 55 56 57 58 |
# File 'lib/search_kit/messages/messaging.rb', line 54 def password_prompt cli.ask(Prefixed(.ansi(:cyan))) do |prompt| prompt.echo = '*' end end |
#prompt ⇒ Object
50 51 52 |
# File 'lib/search_kit/messages/messaging.rb', line 50 def prompt cli.ask(Prefixed(.ansi(:cyan))) end |