Sha256: 5ce513014bdd99c57884dd1220233f23f0b75e1904b14b1e790379ad383f0647

Contents?: true

Size: 900 Bytes

Versions: 1

Compression:

Stored size: 900 Bytes

Contents

# frozen_string_literal: true
require_relative './strategy/student_list_base'
class StudentFileAdapter
  def initialize(type_file,file_address)
    @file = StudentListBase.new(type_file)
    @file.load_from_file(file_address)
    @file_address = file_address
  end

  def student_by_id(id_student)
    @file.student_by_id(id_student)
  end

  def add_student(student)
    @file.add_student(student)
    @file.save_to_file(@file_address)
  end

  def delete_student(id_student)
    @file.delete_student(id_student)
    @file.save_to_file(@file_address)
  end

  def replace_student(id_student, student)
    @file.replace_student(id_student, student)

    @file.save_to_file(@file_address)
  end

  def count_student
    @file.count_student
  end

  def get_k_n_student_short_list(page,n, data_list)
    @file.get_k_n_student_short_list(page, n, data_list)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shanti555890-1.1.5 lib/source/database/student_file_adapter.rb