# PLEASE DO NOT EDIT THIS CODE
# This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language!
# NOTE: Ruby generator is experimental and is missing some features available in
# in other Umple generated languages like Java or PHP

module Example

class Student


  #------------------------
  # MEMBER VARIABLES
  #------------------------

  #Student Attributes - for documentation purposes
  #attr_reader :number

  #Student Associations - for documentation purposes
  #attr_reader :mentor

  #------------------------
  # CONSTRUCTOR
  #------------------------

  def initialize(a_number, a_mentor)
    @initialized = false
    @deleted = false
    @number = a_number
    @can_set_number = false
    @can_set_mentor = true
    unless set_mentor(a_mentor)
      raise "Unable to create Student due to a_mentor. See https://manual.umple.org?RE002ViolationofAssociationMultiplicity.html" 
    end
    @initialized = true
  end

  #------------------------
  # INTERFACE
  #------------------------

  def get_number
    raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?)
    @number
  end

  def get_mentor
    raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?)
    @mentor
  end

  def set_mentor(a_new_mentor)
    was_set = false
    raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?)
    return false unless @can_set_mentor
    @can_set_mentor = false
    unless a_new_mentor.nil?
      @mentor = a_new_mentor
      was_set = true
    end
    was_set
  end

  def delete
    @deleted = true
    raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?)
  end

end
end
# PLEASE DO NOT EDIT THIS CODE
# This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language!
# NOTE: Ruby generator is experimental and is missing some features available in
# in other Umple generated languages like Java or PHP

module Example

class Mentor


  #------------------------
  # MEMBER VARIABLES
  #------------------------

  #Mentor Attributes - for documentation purposes
  #attr_reader :name

  #------------------------
  # CONSTRUCTOR
  #------------------------

  def initialize(a_name)
    @initialized = false
    @deleted = false
    @name = a_name
    @can_set_name = false
    @initialized = true
  end

  #------------------------
  # INTERFACE
  #------------------------

  def get_name
    @name
  end

  def delete
    @deleted = true
  end

end
end