Closed
Description
So I have something similiar to the example code. If I do this:
module MyApi
# this is an "abstract" base class that
class Base < JsonApiClient::Resource
# set the api base url in an abstract base class
self.site = "http://example.com/"
end
end
everything works.
If I try and set the site var outside of MyApi::Base, it fails.
If I have
MyApi::Base.site = "http://example.com/"
module MyApi
# this is an "abstract" base class that
class Base < JsonApiClient::Resource
end
end
the connection fails with the error of
# Errno::ECONNREFUSED:
# Connection refused - connect(2) for nil port 80
Using pry, if I get the following:
[1] pry(#<RSpec::ExampleGroups::RecordType>)> MyApi::Base.site
=> "http://example.com/"
[2] pry(#<RSpec::ExampleGroups::RecordType>)> cd MyApi::Base
[3] pry(MyApi::Base):1> self.site
=> "http://example.com/"
[4] pry(MyApi::Base):1> site
=> "http://example.com/"
which is what I expect. I'm not sure what's happening...
Metadata
Metadata
Assignees
Labels
No labels