Class: Gaku::StudentDecorator
Instance Method Summary
collapse
#formatted_name, #formatted_name_reading, #full_name, #full_name_reading, #sex_and_birth, #student_names
Instance Method Details
#badges_list ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'app/decorators/gaku/student_decorator.rb', line 6
def badges_list
h.comma_separated_list(object.badges) do |badge|
if badge.badge_type.badge_image_file_name.nil?
badge.badge_type.name
else
"#{badge.badge_type.name} (#{h.resize_image(badge.badge_type.badge_image, size: 22)})"
end
end
end
|
#class_group ⇒ Object
28
29
30
31
|
# File 'app/decorators/gaku/student_decorator.rb', line 28
def class_group
cg = object.class_groups.last
cg.blank? ? 'Empty' : cg
end
|
#seat_number ⇒ Object
33
34
35
36
|
# File 'app/decorators/gaku/student_decorator.rb', line 33
def seat_number
sn = object.class_group_enrollments.last
sn.blank? ? '' : sn.seat_number
end
|
#simple_grades_list ⇒ Object
16
17
18
19
20
|
# File 'app/decorators/gaku/student_decorator.rb', line 16
def simple_grades_list
h.comma_separated_list(object.simple_grades) do |simple_grade|
"#{simple_grade.simple_grade_type_name}"
end
end
|
#student_specialties_list ⇒ Object
22
23
24
25
26
|
# File 'app/decorators/gaku/student_decorator.rb', line 22
def student_specialties_list
h.comma_separated_list(object.student_specialties) do |student_specialty|
"#{student_specialty.specialty} (#{major_check(student_specialty)})"
end
end
|