How do I assign a value to another class's initialize parameter in Ruby
class Ubac
def initialize(p_str)
@p_str=p_str
(.....)
end
def method1
(.....)
end
end
class ReqQuote < Ubac
def initialize(p_code)
@code=p_code
# here how do i initialize the @p_str to the value which is returned from the get_data method below.?
end
def get_data(symbol)
(....) # fetch data
data
end
def methodx
(.....)
end
end
Here how do I initialize @p_str
with the value which is returned from the get_data
method as if p_str
was initialized from the Ubac
class's initialize
?