# -----------------------------------------------------------------------------
# Name:        student
# Purpose:     contains the class definitions for students
#
# Author:      Rula Khayrallah
#
# Created:     10/12/2014
# -----------------------------------------------------------------------------
"""
Module to describe students in a college setting.

"""
class Student(object):

    """
    Represent a student.

    Arguments:
    name (string): student name
    sid (int): student id - 8 digits

    Attributes:
    name (string): student name
    sid (int): student id - 8 digits
    """

    number_of_students = 0

    def __init__(self,  name, sid):
        self.name = name
        if self.valid(sid):
            self.sid = sid
        else:
            self.sid = 0
        self.update_count()  # invoke the class method

    @staticmethod
    def valid(some_id):
        """" A valid student id starts with 2015 """
        if some_id // 10000 == 2015:
            return True
        else:
            return False

    @classmethod
    def update_count(cls):
        cls.number_of_students += 1  # update the class variable
