Class: Factor::Commands::Command
- Inherits:
-
Object
- Object
- Factor::Commands::Command
- Defined in:
- lib/commands/base.rb
Overview
Base command with common methods used by all commands
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_FILENAME =
{ connectors: File.('./connectors.yml'), credentials: File.('./credentials.yml') }
Instance Attribute Summary collapse
-
#destination_stream ⇒ Object
Returns the value of attribute destination_stream.
Instance Method Summary collapse
- #error(options = {}) ⇒ Object
- #exception(message, exception) ⇒ Object
- #info(options = {}) ⇒ Object
- #load_config(options = {}) ⇒ Object
- #success(options = {}) ⇒ Object
- #warn(options = {}) ⇒ Object
Instance Attribute Details
#destination_stream ⇒ Object
Returns the value of attribute destination_stream.
17 18 19 |
# File 'lib/commands/base.rb', line 17 def destination_stream @destination_stream end |
Instance Method Details
#error(options = {}) ⇒ Object
23 24 25 |
# File 'lib/commands/base.rb', line 23 def error( = {}) log_line :error, end |
#exception(message, exception) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/commands/base.rb', line 35 def exception(, exception) error 'message' => error 'message' => " #{exception.}" exception.backtrace.each do |line| error 'message' => " #{line}" end end |
#info(options = {}) ⇒ Object
19 20 21 |
# File 'lib/commands/base.rb', line 19 def info( = {}) log_line :info, end |
#load_config(options = {}) ⇒ Object
43 44 45 46 |
# File 'lib/commands/base.rb', line 43 def load_config( = {}) load_config_data :credentials, load_config_data :connectors, end |
#success(options = {}) ⇒ Object
31 32 33 |
# File 'lib/commands/base.rb', line 31 def success( = {}) log_line :success, end |
#warn(options = {}) ⇒ Object
27 28 29 |
# File 'lib/commands/base.rb', line 27 def warn( = {}) log_line :warn, end |