Module: AeriesApi::Client::Students

Included in:
AeriesApi::Client
Defined in:
lib/aeries-api/client/students.rb

Instance Method Summary collapse

Instance Method Details

#student(school_code:, student_id:) ⇒ Object



6
7
8
9
# File 'lib/aeries-api/client/students.rb', line 6

def student(school_code:, student_id:)
  response = self.class.get("/schools/#{school_code}/students/#{student_id}")
  mash_and_underscore_keys(response.parsed_response)
end

#students(school_code:, grade: nil) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/aeries-api/client/students.rb', line 11

def students(school_code:, grade: nil)
  if grade
    endpoint = "/schools/#{school_code}/students/grade/#{grade}"
  else
    endpoint = "/schools/#{school_code}/students"
  end
  response = self.class.get(endpoint)
  mash_and_underscore_keys(response.parsed_response)
end