Class: Translatomatic::CLI::Config
- Defined in:
- lib/translatomatic/cli/config.rb
Overview
Configuration functions for the command line interface
Instance Method Summary collapse
-
#add(key, *value) ⇒ String
Add a configuration setting to a list.
-
#describe ⇒ Object
Describe available configuration settings.
-
#list ⇒ Object
List current configuration settings.
-
#set(key, *value) ⇒ String
Change a configuration setting.
-
#subtract(key, value) ⇒ void
Remove a configuration setting from a list.
-
#unset(key) ⇒ void
Remove a configuration setting.
Instance Method Details
#add(key, *value) ⇒ String
Add a configuration setting to a list
43 44 45 |
# File 'lib/translatomatic/cli/config.rb', line 43 def add(key, *value) run { conf.add(key, value, config_params) } end |
#describe ⇒ Object
Describe available configuration settings
73 74 75 76 77 |
# File 'lib/translatomatic/cli/config.rb', line 73 def describe run do print_config_table(columns: %i[key type desc]) end end |
#list ⇒ Object
List current configuration settings
63 64 65 66 67 |
# File 'lib/translatomatic/cli/config.rb', line 63 def list run do print_config_table(columns: %i[key value], skip_blanks: true) end end |
#set(key, *value) ⇒ String
Change a configuration setting
22 23 24 |
# File 'lib/translatomatic/cli/config.rb', line 22 def set(key, *value) run { conf.set(key, value, config_params) } end |
#subtract(key, value) ⇒ void
This method returns an undefined value.
Remove a configuration setting from a list
54 55 56 |
# File 'lib/translatomatic/cli/config.rb', line 54 def subtract(key, value) run { conf.subtract(key, value, config_params) } end |
#unset(key) ⇒ void
This method returns an undefined value.
Remove a configuration setting
32 33 34 |
# File 'lib/translatomatic/cli/config.rb', line 32 def unset(key) run { conf.unset(key, config_params) } end |