Class: Tanuki::Universe::Config
- Inherits:
-
Object
- Object
- Tanuki::Universe::Config
- Defined in:
- lib/tanuki/universe/config.rb
Instance Attribute Summary collapse
-
#endpoints ⇒ Object
readonly
Returns the value of attribute endpoints.
Instance Method Summary collapse
- #global_config(config) ⇒ Object
-
#initialize(config_path) ⇒ Config
constructor
A new instance of Config.
- #parse_config_file ⇒ Object
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
#endpoints ⇒ Object (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_file ⇒ Object
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 |