Class: LearnProxy::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/work_together/learn_proxy.rb

Constant Summary collapse

CSV_URL =
-> (batch_id) {"https://learn.co/batches/#{batch_id}/students.csv"}

Instance Method Summary collapse

Constructor Details

#initialize(credentials) ⇒ Client

Returns a new instance of Client.



7
8
9
# File 'lib/work_together/learn_proxy.rb', line 7

def initialize(credentials)
  @credentials = credentials
end

Instance Method Details

#csv_for(batch_id) ⇒ Object



11
12
13
# File 'lib/work_together/learn_proxy.rb', line 11

def csv_for(batch_id)
  connection.get(CSV_URL[batch_id]).body
end