Here is my code
This code creates an instance of the Blub class, then prints two strings. For some reason @soaps_a doesn't work.
My code is:
class Blub
# This creates 3 strings
@soaps_a = "soap a"
def say_hello()
puts "hi"
puts @soaps_a
end
end
# Bunch of Blubs
w = Blub.new()
w.say_hello()
and the output is:
hi
but for some reason @soaps_a (which is 'soap a') doesn't work.
The output should be
hi
soap a
Why are strings not working in Ruby? @soap_a is a local variable, and should be accessible in say_hello, but it isn't printing so IDK? :/
any help would be appreciated, why isn't my string printer working?