Class: CampusIvy::Resources::StudentReference

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/campus_ivy/resources/student_reference.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ StudentReference

Returns a new instance of StudentReference.



9
10
11
# File 'lib/campus_ivy/resources/student_reference.rb', line 9

def initialize(client)
  @client = client
end

Instance Method Details

#create(student_id:, reference_id: nil, reference1: nil, reference2: nil, reference3: nil, reference4: nil, reference5: nil) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/campus_ivy/resources/student_reference.rb', line 49

def create(
  student_id:,
  reference_id: nil,
  reference1: nil,
  reference2: nil,
  reference3: nil,
  reference4: nil,
  reference5: nil
)
  payload = {
    StudentId: student_id,
    ReferenceId: reference_id,
    Reference1: reference1,
    Reference2: reference2,
    Reference3: reference3,
    Reference4: reference4,
    Reference5: reference5
  }.compact

  response = @client.connection.post('StudentReference') do |req|
    req.body = payload
  end
  CampusIvy::Object.new(response.body)
end

#list(institution_student_id: nil, student_id_list: nil, start_date: nil, end_date: nil) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/campus_ivy/resources/student_reference.rb', line 21

def list(
  institution_student_id: nil,
  student_id_list: nil,
  start_date: nil,
  end_date: nil
)
  params = {
    'request.institutionStudentId' => institution_student_id,
    'request.studentIdList' => student_id_list,
    'request.startDate' => start_date,
    'request.endDate' => end_date
  }.compact

  response = @client.connection.get('StudentReference', params)
  CampusIvy::Object.new(response.body)
end