Class: ShnaiderCode::DataListStudentShort

Inherits:
DataList
  • Object
show all
Defined in:
lib/source/data_list_student_short.rb

Instance Attribute Summary

Attributes inherited from DataList

#list

Attributes included from DataListNotifier

#data_list_observers

Instance Method Summary collapse

Methods inherited from DataList

#add_observer, #get_selected_objects, #notify, #remove_observer, #select

Methods included from DataListNotifier

#notify

Constructor Details

#initialize(list:, data_constructor:) ⇒ DataListStudentShort

Returns a new instance of DataListStudentShort.



9
10
11
12
13
# File 'lib/source/data_list_student_short.rb', line 9

def initialize(list:, data_constructor:) 
    self.data_constructor = data_constructor

    super(list: list)
end

Instance Method Details

#get_dataObject



19
20
21
# File 'lib/source/data_list_student_short.rb', line 19

def get_data 
    self.data_constructor.execute(list, get_names)
end

#get_namesObject



15
16
17
# File 'lib/source/data_list_student_short.rb', line 15

def get_names
    ["ID", "Фамилия", "Имя", "Отчество", "Гит", "Телега", "Телефон", "Почта"]
end

#list=(new_list) ⇒ Object



23
24
25
26
# File 'lib/source/data_list_student_short.rb', line 23

def list=(new_list)
    @list = new_list
    notify()
end