lib/restful_resource/base.rb in restful_resource-0.8.1 vs lib/restful_resource/base.rb in restful_resource-0.8.2
- old
+ new
@@ -5,25 +5,21 @@
def self.http=(http)
@@http = http
end
def self.http
- @@http ||= RestfulResource::HttpClient.new(authorization: @base_authorization)
+ @@http ||= RestfulResource::HttpClient.new(authorization: superclass.base_authorization)
end
def self.http_authorization(user, password)
@base_authorization = RestfulResource::Authorization.http_authorization(user, password)
end
def self.base_url=(url)
@base_url = URI.parse(url)
end
- def self.base_url
- @base_url
- end
-
def self.resource_path(url)
@resource_path = url
end
def self.find(id, params={})
@@ -55,9 +51,18 @@
@action_prefix = action_prefix.to_s
end
def as_json(options=nil)
@inner_object.send(:table).as_json(options)
+ end
+
+ protected
+ def self.base_url
+ @base_url
+ end
+
+ def self.base_authorization
+ @base_authorization
end
private
def self.merge_url_paths(uri, *paths)
uri.merge(paths.compact.join('/')).to_s