I have two classes:
class Ios
REST_ENDPOINT = 'http://rest'
SOAP_ENDPOINT = 'http://soap'
end
class Android
REST_ENDPOINT = 'http://rest'
SOAP_ENDPOINT = 'http://soap'
end
Then I have two classes for REST and SOAP:
class REST
def some_action
# I want to use the endpoint based on device type
end
end
class SOAP
def some_action
# I want to use the endpoint based on device type
end
end
How can I use the end_point URLs based on device type in REST and SOAP classes?
Regards,
Kayen
is this something you are trying to achieve?
you could also use some refactoring like this:
Mixin
Include Mixin in your classes
Some Testing:
Here is a working demo