Class: Backend::SynchronizationsController::CartoDBConnection

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/backend/synchronizations_controller.rb

Instance Method Summary collapse

Constructor Details

#initialize(account, key) ⇒ CartoDBConnection

Returns a new instance of CartoDBConnection.


76
77
78
79
# File 'app/controllers/backend/synchronizations_controller.rb', line 76

def initialize(, key)
  @account = 
  @key = key
end

Instance Method Details

#exec(sql) ⇒ Object


81
82
83
84
# File 'app/controllers/backend/synchronizations_controller.rb', line 81

def exec(sql)
  Rails.logger.debug "[#{@account}] #{sql}"
  Rails.logger.debug "[#{@account}] " + Net::HTTP.get(URI.parse("http://#{@account}.cartodb.com/api/v2/sql?q=#{URI.encode(sql)}&api_key=#{@key}"))
end