Module: Wpxf::OutputEmitters
- Included in:
- Module
- Defined in:
- lib/wpxf/core/output_emitters.rb
Overview
Provides methods for emitting events that should output information to the user interface of the calling application.
Instance Method Summary collapse
-
#emit_error(message, verbose = false) ⇒ Object
Emit an error event.
-
#emit_info(message, verbose = false) ⇒ Object
Emit a general info event.
-
#emit_success(message, verbose = false) ⇒ Object
Emit a successful operation event.
-
#emit_table(rows, verbose = false) ⇒ Object
Emit an event containing tabular data.
-
#emit_warning(message, verbose = false) ⇒ Object
Emit a warning event.
Instance Method Details
#emit_error(message, verbose = false) ⇒ Object
Emit an error event.
46 47 48 49 50 51 52 53 |
# File 'lib/wpxf/core/output_emitters.rb', line 46 def emit_error(, verbose = false) event_emitter.emit( event: :output, verbose: verbose, type: :error, msg: ) end |
#emit_info(message, verbose = false) ⇒ Object
Emit a general info event.
22 23 24 25 26 27 28 29 |
# File 'lib/wpxf/core/output_emitters.rb', line 22 def emit_info(, verbose = false) event_emitter.emit( event: :output, verbose: verbose, type: :info, msg: ) end |
#emit_success(message, verbose = false) ⇒ Object
Emit a successful operation event.
10 11 12 13 14 15 16 17 |
# File 'lib/wpxf/core/output_emitters.rb', line 10 def emit_success(, verbose = false) event_emitter.emit( event: :output, verbose: verbose, type: :success, msg: ) end |
#emit_table(rows, verbose = false) ⇒ Object
Emit an event containing tabular data.
58 59 60 61 62 63 64 65 |
# File 'lib/wpxf/core/output_emitters.rb', line 58 def emit_table(rows, verbose = false) event_emitter.emit( event: :output, verbose: verbose, type: :table, rows: rows ) end |
#emit_warning(message, verbose = false) ⇒ Object
Emit a warning event.
34 35 36 37 38 39 40 41 |
# File 'lib/wpxf/core/output_emitters.rb', line 34 def emit_warning(, verbose = false) event_emitter.emit( event: :output, verbose: verbose, type: :warning, msg: ) end |