Method: CodeLabs::Lab#add_tech

Defined in:
lib/code_labs/lab.rb

#add_tech(tech) ⇒ Object

<- enforce type and relationships

Raises:

  • (TypeError)


26
27
28
29
30
# File 'lib/code_labs/lab.rb', line 26

def add_tech(tech) # <- enforce type and relationships

    raise TypeError unless tech.is_a?(CodeLabs::Tech)
    @techs << tech
    tech.add_lab(self) unless tech.labs.include?(self) # <- potenial infinte loop

end