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.


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

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

Instance Method Details

#exec(sql) ⇒ Object


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

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