Class: Kuzya::UrlBuilder
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args, config) ⇒ UrlBuilder
constructor
A new instance of UrlBuilder.
Methods inherited from Service
Constructor Details
#initialize(args, config) ⇒ UrlBuilder
Returns a new instance of UrlBuilder.
4 5 6 7 |
# File 'lib/kuzya/url_builder.rb', line 4 def initialize(args, config) @args = args @config = config end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/kuzya/url_builder.rb', line 9 def call url = '' config.shortcuts.dup.tap do |conf| args.each do |key| conf = conf.fetch(key, { '_url' => key }) url += "#{conf.fetch('_url')}/" end end url.chop end |