example/yaml_students/yaml_students.rb
# create_student is a very basic function to create a new record in
# the student yaml file.
# The student is created in memory.
# To save it in the file, use save_data.
#
# *Args*:
# - +name+   : This is a generic name. It can be a surname as well
# - +fields+ : Fields is a Hash list of data to add in the student
#              It can be any kind of field name. But at least 2 are required:
#   - :first_name : First name of the student
#   - :last_name  : Last name of the student
#
# Ex:
# create_student('rob', :last_name => 'Redford', :first_name => 'Robert',
#                :class_room => 'Art Drama', :comment => 'Is a good student')
create_student is a very basic function to create a new record in
the student yaml file.
The student is created in memory.
To save it in the file, use save_data.

Args*:
+name+   : This is a generic name. It can be a surname as well
+fields+ : Fields is a Hash list of data to add in the student
It can be any kind of field name.


create_student is a very basic function to create a new record in the student yaml file . The student is created in memory . To save it in the file use save_data . Args * : + name + : This is a generic name . It can be a surname as well + fields + : Fields is a Hash list of data to add in the student It can be any kind of field name .
def create_student(name, fields)
    if fields[:first_name].nil? || fields[:last_name].nil?
      puts 'YAML API: Unable to create a student. '\
           ':first_name and :last_name required.'
      return nil
    end
    result = create_data(name, fields)
    save_data
    result
  end
def create_student ( name , fields ) if fields [ :first_name ] . nil? || fields [ :last_name ] . nil? puts 'YAML API: Unable to create a student. ' ':first_name and :last_name required.' return nil end result = create_data ( name , fields ) save_data result end
create_student is a very basic function to create a new record in
the student yaml file.
create_student is a very basic function to create a new record in the student yaml file .
name
<not_specific>
fields
<not_specific>