-1

I'm taking a ruby fundamentals counse in pluralsight but some of the code from the instructor isn't working. Could someone please explain what's missing & why whatever is missing is needed? Thank you so much

class Probe
  def deploy(deploy_time, return_time)
    puts "Deploying"
  end
end

class MineralProbe < Probe
  def deploy(deploy_time)
    puts "Preparing sample chamber"
    super(deploy_time, Time.now + 2 * 60)
  end
end

Mineralprobe.new.deploy(Time.now)

The error I'm getting is this: C:\Ruby26-x64\bin\ruby.exe C:/Users/-/RubymineProjects/test1/probe.rb Traceback (most recent call last): C:/Users/-/RubymineProjects/test1/probe.rb:14:in `': uninitialized constant Mineralprobe (NameError) Did you mean? MineralProbe

Process finished with exit code 1

cloud712
  • 25
  • 1
  • 3
  • I think the message, `uninitialized constant Mineralprobe (NameError) Did you mean? MineralProbe` is very clear and quite helpful already. What part of that error message are you having trouble with? – Kache Sep 08 '20 at 04:11
  • `Mineralprobe.new.deploy(Time.now)` should be `MineralProbe.new.deploy(Time.now)` watch out the case since Ruby is case-sensitive – aaron Sep 08 '20 at 05:30
  • ohhhh wow I'm dump ty! – cloud712 Sep 08 '20 at 22:00

1 Answers1

1

There is a simple type the class is called

class MineralProbe < Probe
             ^

but you try to initialize an instance of

Mineralprobe.new.deploy(Time.now)
       ^
spickermann
  • 100,941
  • 9
  • 101
  • 131