why is it said that in ruby instance method gets inherited by the subclass instead of instance variable of the superclass ? from the code one can clearly see that @order which is a instance variable in ruby is inherited by the subclass method Price_demand
class Management
def price
@OrderNo=4
@Order =4
puts "the price of order #{@OrderNo.to_s} is $40"
end
def exe
puts "print #{@Order.to_s}"
end
def rant
puts "please hurry with the order"
end
end
class Waiter < Management
def Price_demand
puts "the price of #{@Order.to_s} is $5"
end
end
a=Waiter.new
a.price
a.exe
a.Price_demand
puts a.instance_variables
...instead of instance variable of the superclass- can you cite any documentation to support your statement?