Class: Configjson::RubyConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/configjson.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_dir_path = ".") ⇒ RubyConfig

Returns a new instance of RubyConfig.



7
8
9
10
11
12
# File 'lib/configjson.rb', line 7

def initialize(config_dir_path = ".")
  env = readEnv
  path = config_dir_path + "/config/" + env + ".json"
  data = File.read(path);
  @json = JSON.parse(data)
end

Instance Method Details

#get(dot_notation) ⇒ Object



14
15
16
# File 'lib/configjson.rb', line 14

def get(dot_notation)
  object = get_object(@json, dot_notation)
end