Class: Podio::Importer

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/importer.rb

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes, #error_code, #error_message, #error_parameters, #error_propagate

Class Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, handle_api_errors_for, has_many, has_one, #hash, #initialize, #initialize_attributes, list, member, #new_record?, output_attribute_as_json, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.get_columns(file_id) ⇒ Object



13
14
15
# File 'lib/podio/models/importer.rb', line 13

def get_columns(file_id)
  list Podio.connection.get("/importer/#{file_id}/column/").body
end

.get_info(file_id) ⇒ Object



17
18
19
# File 'lib/podio/models/importer.rb', line 17

def get_info(file_id)
  Podio.connection.get("/importer/#{file_id}/info").body
end

.preview(file_id, row, options) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/podio/models/importer.rb', line 21

def preview(file_id, row, options)
  response = Podio.connection.post do |req|
    req.url "/importer/#{file_id}/preview/#{row}"
    req.body = options
  end

  response.body
end

.process_file(file_id, options = {}) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/podio/models/importer.rb', line 4

def process_file(file_id, options = {})
  response = Podio.connection.post do |req|
    req.url "/importer/#{file_id}/process"
    req.body = options
  end

  response.body
end