Sha256: c82f526cf8584f3e6feac15c53cb4e1f0a3fb3dec88ff5046df6cd09302cc7dc

Contents?: true

Size: 1019 Bytes

Versions: 3

Compression:

Stored size: 1019 Bytes

Contents

require "source/attr_limited_regex_accessor.rb"

module ShnaiderCode
    class StudentsList 
        attr_private_accessor :students_list_adapter

        def initialize(adapter)
            self.students_list_adapter = adapter
        end

        def get_student(id)
            students_list_adapter.get_student(id)
        end

        def remove_student(id)
            students_list_adapter.remove_student(id)
        end

        def replace_student(id, student)
            students_list_adapter.replace_student(id, student)
        end

        def get_students(from, to, data)
            values = students_list_adapter.get_students(from, to)

            if data == nil
                data = DataList.new(list: values)
            else
                data.list = values
            end

            data.list
        end

        def add_student(student)
            students_list_adapter.add_student(student)
        end

        def count
            students_list_adapter.count()
        end
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shnaider_code-2.0.4 lib/source/students_list.rb
shnaider_code-2.0.3 lib/source/students_list.rb
shnaider_code-2.0.2 lib/source/students_list.rb