I’m a newbie and having some issues calling a method from another
class. I keep getting an error saying undefined method. The method I’m
trying to call is in the employees.rb file and I’m trying to run it in
my business.rb file. Its option 2 in my case statement.
I’m a newbie and having some issues calling a method from another
class. I keep getting an error saying undefined method. The method I’m
trying to call is in the employees.rb file and I’m trying to run it in
my business.rb file. Its option 2 in my case statement.
in business.rb, you have :
when 2
new_employee(name)
new_employee() is a method member of class Employees.
if you want call him out of instance; declare it
as static methode:
def self.new_employee()
puts “What is the employees name?”
name = gets.chomp
e1 = Employees.new(name)
end