Class: Tanuki::Universe::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/tanuki/universe/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_path) ⇒ Config

Returns a new instance of Config.



9
10
11
12
# File 'lib/tanuki/universe/config.rb', line 9

def initialize(config_path)
  @config_path = config_path
  parse_config_file
end

Instance Attribute Details

#endpointsObject (readonly)

Returns the value of attribute endpoints.



7
8
9
# File 'lib/tanuki/universe/config.rb', line 7

def endpoints
  @endpoints
end

Instance Method Details

#global_config(config) ⇒ Object



22
23
24
25
# File 'lib/tanuki/universe/config.rb', line 22

def global_config(config)
  @endpoints = config['endpoints']
  #@build_interval = config['build_interval']
end

#parse_config_fileObject



14
15
16
17
18
19
20
# File 'lib/tanuki/universe/config.rb', line 14

def parse_config_file
  parsed_config = {}
  File.open(@config_path) do |file|
    parsed_config = JSON.load(file)
  end
  global_config(parsed_config)
end