require 'diplomat'

module Idxprb
  class Configurator
    def initialize(key)
      @key = key
    end

    def configs
      @configs ||= JSON.parse(load_configs)
    end

    private

    def load_configs
      if ENV['PRODUCTION']
        Diplomat::Kv.get(@key)
      else
        File.read('config.json')
      end
    end
  end
end