summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-06-06 19:23:42 +0200
committerFrancisco Javier López <fjlopez@gitlab.com>2018-06-06 19:24:00 +0200
commit94b9485e88580895702398befbc5d0f2971cabf9 (patch)
treee467a7525be92e94b74ab6eb975eea3754d58ff7
parent4cc0076c3bc6d8dcfab31d47fa0c8edf4788ee6b (diff)
downloadgitlab-ce-94b9485e88580895702398befbc5d0f2971cabf9.tar.gz
Using singleton module
-rw-r--r--lib/api/helpers/full_route_builder.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/api/helpers/full_route_builder.rb b/lib/api/helpers/full_route_builder.rb
index e7793c580aa..1afa1fc8249 100644
--- a/lib/api/helpers/full_route_builder.rb
+++ b/lib/api/helpers/full_route_builder.rb
@@ -1,16 +1,13 @@
module API
module Helpers
class FullRouteBuilder
+ include Singleton
include ::API::Helpers::RelatedResourcesHelpers
def self.full_url(api_route_name, params)
- return unless builder.respond_to? api_route_name
+ return unless instance.respond_to? api_route_name
- builder.expose_url(builder.send(api_route_name, params))
- end
-
- def self.builder
- @builder ||= new
+ instance.expose_url(instance.send(api_route_name, params))
end
end
end