Class: Clever::Types::SchoolAdmin

Inherits:
Teacher show all
Defined in:
lib/clever/types/school_admin.rb

Instance Attribute Summary

Attributes inherited from Teacher

#email, #first_name, #last_name, #provider, #role, #uid

Instance Method Summary collapse

Methods inherited from Teacher

#to_h, #username

Methods inherited from Base

#blank?, #presence, #to_h

Constructor Details

#initialize(attributes = {}, client: nil) ⇒ SchoolAdmin

Returns a new instance of SchoolAdmin.



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/clever/types/school_admin.rb', line 6

def initialize(attributes = {}, *, client: nil)
  @district_username = attributes.dig('roles', 'staff', 'credentials', 'district_username')
  @email             = attributes['email']
  @first_name        = attributes['name']['first']
  @last_name         = attributes['name']['last']
  @provider          = 'clever'
  @sis_id            = attributes.dig('roles', 'staff', 'sis_id')
  @uid               = attributes['id']
  @username          = username(client)
  @role              = 'admin'
end