How do you call the method of an included class in Ruby? See the example below. This works, but it is not what I want:
require 'httparty'
module MyModule
class MyClass
include HTTParty
base_uri 'http://localhost'
def initialize(path)
# other code
end
end
end
This is what I want, but doesn't work, saying undefined method 'base_uri' [...]
. What I'm trying to do is to set the base_uri of httparty dynamically from the initialize parameter.
require 'httparty'
module MyModule
class MyClass
include HTTParty
def initialize(path)
base_uri 'http://localhost'
# other code
end
end
end