Sha256: 24b381388b77657e45c831515e539f4849c5d3ac2e9bf158034f7ce5d976df08

Contents?: true

Size: 682 Bytes

Versions: 13

Compression:

Stored size: 682 Bytes

Contents

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
eco-helpers-1.5.14 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.13 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.12 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.11 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.10 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.9 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.8 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.7 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.6 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.5 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.4 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.3 lib/eco/api/microcases/people_cache.rb
eco-helpers-1.5.2 lib/eco/api/microcases/people_cache.rb