Sha256: 261ae230cc95170b47d4f1435cef1710ec5488dc2e9a4d7e38a5fedeb9d0c47f
Contents?: true
Size: 748 Bytes
Versions: 4
Compression:
Stored size: 748 Bytes
Contents
# frozen_string_literal: true require_relative './students_db.rb' class StudentListDB attr_accessor :database @@instance = nil def self.instance @@instance ||= StudentListDB.new end def initialize self.database = StudentDB.new() end def get_student(id) Student.from_hash(database.select_by_id(id).transform_keys(&:to_sym)) end def remove_student(id) database.remove_by_id(id) end def replace_student(id, student) database.replace_by_id(id, student) end def add_student(student) database.add_student(student.to_hash) end def get_students_pag(k, n, data) database.get_students_pag(k, n, data) end def count database.count end end
Version data entries
4 entries across 4 versions & 2 rubygems