lib/fb_graph/node.rb in fb_graph-2.7.14 vs lib/fb_graph/node.rb in fb_graph-2.7.15
- old
+ new
@@ -88,10 +88,14 @@
end
end
alias_method :cache_collection, :cache_collections
def build_endpoint(params = {})
- File.join([self.endpoint, params.delete(:connection), params.delete(:connection_scope)].compact.collect(&:to_s))
+ _endpoint_ = URI.parse self.endpoint
+ if api_version = params.delete(:api_version)
+ _endpoint_.path = File.join('/', api_version, _endpoint_.path)
+ end
+ File.join([_endpoint_.to_s, params.delete(:connection), params.delete(:connection_scope)].compact.collect(&:to_s))
end
def build_params(params)
_params_ = params.dup
_params_[:access_token] ||= self.access_token