Within the Class I define things which I would expect to be Global.
Both the matrix and the reference to class are not seen in the method
calculate, as they fall outside of the method declaration. How do I
make them visible, so they can remain where they are( Yes, I could pass
the matrix variable - e.g., calculate(m)- but is there another way to do
this?) I don’t think I could pass subr in this manner.
Class Subroutines
#some subroutines listed here
def altitude(abs_psr_inhg)
#stuff
end
end
Class Ballistics
require ‘Matrix’
m = Matrix[[1,2,3],[4,5,6]]
subr = Subroutines.new
def calculate
puts m
alt = subr.altitude(abs_psr_inhg)
end
end