Sha256: 8eb89918cf26f80d88c17fee21f5ae462f4ad4371a2869715b213310706ad912

Contents?: true

Size: 326 Bytes

Versions: 25

Compression:

Stored size: 326 Bytes

Contents

module NationBuilder

  class URL

    def initialize(url_template)
      @url_template = url_template
    end

    def generate_url(extension, parameters)
      url = URI.join(@url_template, '/api/v1' + extension).to_s
      parameters.each { |name, value| url.gsub!(name.inspect, value.to_s) }
      url
    end

  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
nationbuilder-rb-1.6.2 lib/nationbuilder/url.rb
nationbuilder-rb-1.6.1 lib/nationbuilder/url.rb
nationbuilder-rb-1.6.0 lib/nationbuilder/url.rb
nationbuilder-rb-1.5.0 lib/nationbuilder/url.rb
nationbuilder-rb-1.4.3 lib/nationbuilder/url.rb
nationbuilder-rb-1.4.2 lib/nationbuilder/url.rb
nationbuilder-rb-1.4.1 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.9 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.7 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.6 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.5 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.4 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.3 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.2 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.1 lib/nationbuilder/url.rb
nationbuilder-rb-1.3.0 lib/nationbuilder/url.rb
nationbuilder-rb-1.2.3 lib/nationbuilder/url.rb
nationbuilder-rb-1.2.2 lib/nationbuilder/url.rb
nationbuilder-rb-1.2.1 lib/nationbuilder/url.rb
nationbuilder-rb-1.2.0 lib/nationbuilder/url.rb