Class: Meibo::JapanProfile::Enrollment

Inherits:
Enrollment
  • Object
show all
Defined in:
lib/meibo/japan_profile/enrollment.rb

Direct Known Subclasses

EportalV3::Enrollment

Constant Summary collapse

ROLES =
{
  student: "student",
  teacher: "teacher",
  administrator: "administrator",
  guardian: "guardian"
}.freeze

Instance Method Summary collapse

Methods inherited from Enrollment

#administrator?, #classroom, #collection, #proctor?, #school, #student?, #teacher?, #user

Constructor Details

#initialize(role:, shusseki_no: nil, public_flg: nil, primary: (role == ROLES[:student] ? false : nil), **other_fields) ⇒ Enrollment

NOTE: 児童生徒の場合primaryはfalse固定 MEMO: 保護者の場合もそうでは?



28
29
30
31
32
33
# File 'lib/meibo/japan_profile/enrollment.rb', line 28

def initialize(role:, shusseki_no: nil, public_flg: nil, primary: (role == ROLES[:student] ? false : nil),
               **other_fields)
  super(role: role, primary: primary, **other_fields)
  @shusseki_no = shusseki_no
  @public_flg = public_flg
end

Instance Method Details

#guardian?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/meibo/japan_profile/enrollment.rb', line 35

def guardian?
  role == ROLES[:guardian]
end