Reputation: 10631
I would like to know how would I go about accessing the methods in this module from another .rb file
module Decisioning
module Decision
class OfferProxy < FinanceApplication::Offer
def my_method
"some value"
end
end
end
end
So how would I access my_method from another .rb file?
maby something like
include ::Decisioning::Decision::OfferProxy
can I then use
my_method
Upvotes: 0
Views: 3448
Reputation: 83
Probably more like this:
module Decisioning
module Decision
class OfferProxy
def self.my_method
"some value"
end
end
end
end
class TestFile
include Decisioning::Decision
def test
puts OfferProxy.my_method
end
end
TestFile.new.test
Or...
module Decisioning
module Decision
class OfferProxy
def my_method
"some value"
end
end
end
end
class TestFile
include Decisioning::Decision
def test
offer_proxy = OfferProxy.new
puts offer_proxy.my_method
end
end
TestFile.new.test
Upvotes: 2