# 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, :id #Mentor Associations - for documentation purposes #attr_reader :student #------------------------ # CONSTRUCTOR #------------------------ def initialize(a_name, a_student) @initialized = false @deleted = false @name = a_name @id = nil @student = nil unless a_student.nil? @student = a_student a_student.instance_variable_set("@mentor",self) end @initialized = true end #------------------------ # INTERFACE #------------------------ def set_name(a_name) was_set = false raise "Mandatory relationship with student not satisfied" if (@initialized and !@deleted and @student.nil?) @name = a_name was_set = true was_set end def set_id(a_id) was_set = false raise "Mandatory relationship with student not satisfied" if (@initialized and !@deleted and @student.nil?) @id = a_id was_set = true was_set end def get_name raise "Mandatory relationship with student not satisfied" if (@initialized and !@deleted and @student.nil?) @name end def get_id raise "Mandatory relationship with student not satisfied" if (@initialized and !@deleted and @student.nil?) @id end def get_student raise "Mandatory relationship with student not satisfied" if (@initialized and !@deleted and @student.nil?) @student end def delete @deleted = true raise "Mandatory relationship with student not satisfied" if (@initialized and !@deleted and @student.nil?) existing_student = @student @student = nil unless existing_student.nil? existing_student.delete end 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 Student #------------------------ # MEMBER VARIABLES #------------------------ #Student Attributes - for documentation purposes #attr_reader :name, :number #Student Associations - for documentation purposes #attr_reader :mentor #------------------------ # CONSTRUCTOR #------------------------ def initialize(a_name, a_number, a_mentor) @initialized = false @deleted = false @name = a_name @number = a_number @mentor = nil unless a_mentor.nil? @mentor = a_mentor a_mentor.instance_variable_set("@student",self) end @initialized = true end #------------------------ # INTERFACE #------------------------ def set_name(a_name) was_set = false raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?) @name = a_name was_set = true was_set end def set_number(a_number) was_set = false raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?) @number = a_number was_set = true was_set end def get_name raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?) @name end 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 delete @deleted = true raise "Mandatory relationship with mentor not satisfied" if (@initialized and !@deleted and @mentor.nil?) existing_mentor = @mentor @mentor = nil unless existing_mentor.nil? existing_mentor.delete end end end end