example/yaml_students/yaml_students.rb
# delete_student is a very basic function to delete a record from
# the student yaml file.
# The student is deleted in memory.
# The deletion is simply an update of the :status to :removed
# To save it in the file, use save_data.
#
# *Args*:
# - id: If the student ID.
#
# Ex:
# delete_student(2)
delete_student is a very basic function to delete a record from
the student yaml file.
The student is deleted in memory.
The deletion is simply an update of the :status to :removed
To save it in the file, use save_data.

Args*:
id: If the student ID.


delete_student is a very basic function to delete a record from the student yaml file . The student is deleted in memory . The deletion is simply an update of the : status to : removed To save it in the file use save_data . Args * : id : If the student ID .
def delete_student(sId)
    return false unless File.exist?(file)
    @data[:students].each do |value|
      next unless value[:id] == sId
      @data[:students][sId][:status] = :removed
      save_data
      return 1
    end
    0
  end
def delete_student ( sId ) return false unless File . exist? ( file ) @data [ :students ] . each do | value | next unless value [ :id ] == sId @data [ :students ] [ sId ] [ :status ] = :removed save_data return 1 end 0 end
delete_student is a very basic function to delete a record from
the student yaml file.
delete_student is a very basic function to delete a record from the student yaml file .
sId
<not_specific>