example/yaml_students/yaml_students.rb
# update_student is a very basic function to update a record of
# the student yaml file.
# The student is updated in memory.
# To save it in the file, use save_data.
#
# *Args*:
# - query: Hash of fields to use for the query
#          You can query any fields.
#          Standard one are:
#   - :id         : Student ID
#   - :name       : Student name or surname
#   - :first_name : First name of the student.
#   - :last_name  : Last name of the student.
#   - :status     : :removed if the record is deleted.
#
# Ex:
# query_student(2, :name => 'robby')
update_student is a very basic function to update a record of
the student yaml file.
The student is updated in memory.
To save it in the file, use save_data.

Args*:
query: Hash of fields to use for the query
You can query any fields.


update_student is a very basic function to update a record of the student yaml file . The student is updated in memory . To save it in the file use save_data . Args * : query : Hash of fields to use for the query You can query any fields .
def update_student(id, fields)
    list = query_student(:id => id)
    list[0].merge(fields) if list.length == 1
    save_data
  end
def update_student ( id , fields ) list = query_student ( :id => id ) list [ 0 ] . merge ( fields ) if list . length == 1 save_data end
update_student is a very basic function to update a record of
the student yaml file.
update_student is a very basic function to update a record of the student yaml file .
id
<not_specific>
fields
<not_specific>