Sha256: d5b43bfd571c01700ba7dc374e7b7599b5bd0ae36dd64026369d46082959f2bb
Contents?: true
Size: 518 Bytes
Versions: 12
Compression:
Stored size: 518 Bytes
Contents
# frozen_string_literal: true module PageMagic module Utils # module String - contains methods for manipulating strings module URL class << self # build a url from a base and path. # @example # concat('http://base.url/', '/path') # => "http://base.url/path" # @return [String] def concat(base_url, path) path = path.sub(%r{^/}, '') base_url = base_url.sub(%r{/$}, '') "#{base_url}/#{path}" end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems