Class: Evostream::CLI::Config

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/evostream/cli/config.rb

Overview

Configuration file for CLI

Instance Method Summary collapse

Constructor Details

#initializeConfig

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