diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-06 19:23:42 +0200 |
---|---|---|
committer | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-06 19:24:00 +0200 |
commit | 94b9485e88580895702398befbc5d0f2971cabf9 (patch) | |
tree | e467a7525be92e94b74ab6eb975eea3754d58ff7 | |
parent | 4cc0076c3bc6d8dcfab31d47fa0c8edf4788ee6b (diff) | |
download | gitlab-ce-94b9485e88580895702398befbc5d0f2971cabf9.tar.gz |
Using singleton module
-rw-r--r-- | lib/api/helpers/full_route_builder.rb | 9 |
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 |