Class: StudentList
- Inherits:
-
Object
- Object
- StudentList
- Defined in:
- lib/source/repositories/student_list.rb
Instance Method Summary collapse
-
#add_student(student) ⇒ Object
добавление студента.
-
#initialize(data_adapter) ⇒ StudentList
constructor
конструктор.
-
#k_n_student_short_list(k, n, data_list) ⇒ Object
получение n элементов k страницы.
-
#remove_student(student_id) ⇒ Object
отчисление студента.
-
#replace_student(student_id, student) ⇒ Object
замена студента.
-
#student_by_id(student_id) ⇒ Object
получить студента по id.
-
#student_count ⇒ Object
подсчет количества студентов.
Constructor Details
#initialize(data_adapter) ⇒ StudentList
конструктор
6 7 8 |
# File 'lib/source/repositories/student_list.rb', line 6 def initialize(data_adapter) @data_adapter = data_adapter end |
Instance Method Details
#add_student(student) ⇒ Object
добавление студента
17 18 19 |
# File 'lib/source/repositories/student_list.rb', line 17 def add_student(student) @data_adapter.add_student(student) end |
#k_n_student_short_list(k, n, data_list) ⇒ Object
получение n элементов k страницы
37 38 39 |
# File 'lib/source/repositories/student_list.rb', line 37 def k_n_student_short_list(k,n, data_list) @data_adapter.k_n_student_short_list(k,n,data_list) end |
#remove_student(student_id) ⇒ Object
отчисление студента
22 23 24 |
# File 'lib/source/repositories/student_list.rb', line 22 def remove_student(student_id) @data_adapter.remove_student(student_id) end |
#replace_student(student_id, student) ⇒ Object
замена студента
27 28 29 |
# File 'lib/source/repositories/student_list.rb', line 27 def replace_student(student_id, student) @data_adapter.replace_student(student_id, student) end |
#student_by_id(student_id) ⇒ Object
получить студента по id
11 12 13 |
# File 'lib/source/repositories/student_list.rb', line 11 def student_by_id(student_id) @data_adapter.student_by_id(student_id) end |
#student_count ⇒ Object
подсчет количества студентов
32 33 34 |
# File 'lib/source/repositories/student_list.rb', line 32 def student_count @data_adapter.student_count end |