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
- #debug(options = {}) ⇒ Object
- #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.
18 19 20 |
# File 'lib/commands/base.rb', line 18 def destination_stream @destination_stream end |
Instance Method Details
#debug(options = {}) ⇒ Object
36 37 |
# File 'lib/commands/base.rb', line 36 def debug( = {}) end |
#error(options = {}) ⇒ Object
24 25 26 |
# File 'lib/commands/base.rb', line 24 def error( = {}) log_line :error, end |
#exception(message, exception) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/commands/base.rb', line 39 def exception(, exception) error 'message' => error 'message' => " #{exception.message}" exception.backtrace.each do |line| error 'message' => " #{line}" end end |
#info(options = {}) ⇒ Object
20 21 22 |
# File 'lib/commands/base.rb', line 20 def info( = {}) log_line :info, end |
#load_config(options = {}) ⇒ Object
47 48 49 50 |
# File 'lib/commands/base.rb', line 47 def load_config( = {}) load_config_data :credentials, load_config_data :connectors, end |
#success(options = {}) ⇒ Object
32 33 34 |
# File 'lib/commands/base.rb', line 32 def success( = {}) log_line :success, end |
#warn(options = {}) ⇒ Object
28 29 30 |
# File 'lib/commands/base.rb', line 28 def warn( = {}) log_line :warn, end |