module Teamweek::Api::Importer

Public Instance Methods

bulk_import(entity, data, context) click to toggle source
# File lib/teamweek/api/importer.rb, line 5
def bulk_import(entity, data, context)
  response = bulk_post(entity, data)
  response.map { |h| context.new(h) }
end
bulk_post(entity, data) click to toggle source
# File lib/teamweek/api/importer.rb, line 10
def bulk_post(entity, data)
  client.post(bulk_uri(entity), { entity => data })
end
bulk_uri(entity) click to toggle source
# File lib/teamweek/api/importer.rb, line 14
def bulk_uri(entity)
  full_path("/#{entity}/bulk_import.json")
end