Class: Baleen::Message::ToClient
- Defined in:
- lib/baleen/message/to_client.rb
Instance Method Summary collapse
-
#initialize(opt) ⇒ ToClient
constructor
A new instance of ToClient.
- #print_message ⇒ Object
- #terminate? ⇒ Boolean
Methods inherited from Base
Methods included from Serializable
deserialize, #dup, #method_missing, #params, symbolize_keys, #to_json
Constructor Details
#initialize(opt) ⇒ ToClient
Returns a new instance of ToClient.
7 8 9 10 11 |
# File 'lib/baleen/message/to_client.rb', line 7 def initialize(opt) super() @params[:message] = opt[:message] @params[:level] = opt[:level] end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Baleen::Serializable
Instance Method Details
#print_message ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/baleen/message/to_client.rb', line 17 def case level when "info" hl_info when "warn" hl_warn when "error" hl_error else hl_error "Unknown message level" hl_error inspect end end |
#terminate? ⇒ Boolean
13 14 15 |
# File 'lib/baleen/message/to_client.rb', line 13 def terminate? false end |