Sha256: 070efa1bccf8b2e86f75a3b2303293107a8c4dab1b6ce0b51a880fdec9a1f832

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

require_relative '../student/student.rb'
require_relative '../student_short/student_short.rb'
require_relative '../data_list/data_list_student_short.rb'
require_relative '../binary_tree/binary_tree.rb'
require_relative './students_list_interface.rb'

class Students_list_file_adapter < Students_list_interface
    # constructor
    def initialize(adaptee)
        self.adaptee = adaptee
    end

    # get student by id
    def get_student_by_id(id)
        self.adaptee.get_student_by_id(id)
    end

    # get data_list_student_short of k n students
    def get_k_n_student_short_list(k, n, filter = nil, data_list = nil)
        self.adaptee.get_k_n_student_short_list(k, n, filter, data_list)
    end

    # add student
    def add_student(student)
        self.adaptee.add_student(student)
    end

    # replace student by id
    def replace_student(id, new_student)
        self.adaptee.replace_student(id, new_student)
    end

    # delete student by id
    def delete_student(id)
        self.adaptee.delete_student(id)
    end

    # get count of students
    def get_student_short_count(filter = nil)
        self.adaptee.get_student_short_count(filter)
    end

    private
    attr_accessor :adaptee
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
student_mvp-0.1.10 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.9 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.8 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.7 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.6 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.5 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.4 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.3 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.2 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.1 lib/models/students_list/students_list_file_adapter.rb
student_mvp-0.1.0 lib/models/students_list/students_list_file_adapter.rb