module Eco module API class MicroCases # Helper to locally cache the people manager. # @param filename [String] the name of the file where the data should be cached. # @return [Eco::API::Organization::People] the `People` object with the data. def people_cache(filename = enviro.config.people.cache) logger.info("Going to get all the people via API") people = session.batch.get_people file = file_manager.save_json(people, filename, :timestamp) logger.info("#{people.length} people loaded and saved locally to #{file}.") Eco::API::Organization::People.new(people) end end end end