Class: Evostream::CLI::Config
- Inherits:
-
Object
- Object
- Evostream::CLI::Config
- Includes:
- Singleton
- Defined in:
- lib/evostream/cli/config.rb
Overview
Configuration file for CLI
Instance Method Summary collapse
- #change_host(host) ⇒ Object
- #change_port(port) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #load_custom_file(file) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 |
# File 'lib/evostream/cli/config.rb', line 11 def initialize @options = @uri = nil load_file_configuration Evostream::Service.environment = :production apply_uri end |
Instance Method Details
#change_host(host) ⇒ Object
18 19 20 21 |
# File 'lib/evostream/cli/config.rb', line 18 def change_host(host) @uri.host = host apply_uri end |
#change_port(port) ⇒ Object
23 24 25 26 |
# File 'lib/evostream/cli/config.rb', line 23 def change_port(port) @uri.port = port apply_uri end |
#load_custom_file(file) ⇒ Object
28 29 30 31 32 |
# File 'lib/evostream/cli/config.rb', line 28 def load_custom_file(file) load_yml(file) save_uri apply_uri end |