module Access class Request include HTTParty def get(path, api_type, options={}) set_format results = self.class.get(set_base(api_type) + path, headers: headers, query: options) Access.config.hashify == "true" ? results.hashify : results end private def set_base(api_type) if Access.config.api_environment == 'production' "https://#{api_type}.adcrws.com/#{Access.config.api_version}" else "https://#{api_type}-demo.adcrws.com/#{Access.config.api_version}" end end def set_format self.class.format Access.config.format.to_sym end def headers {"Access-Token" => Access.config.access_token} end end end