Sha256: 3288be697cd00f65b0332b1134f8997632a2f8d86d3be92b07c2c76e01c5166e

Contents?: true

Size: 448 Bytes

Versions: 6

Compression:

Stored size: 448 Bytes

Contents

# -*- encoding : utf-8 -*-
# This middleware prepends the names of the trackers passing through it with a prefix
# and an underscore
class Tracksperanto::Middleware::Prefix < Tracksperanto::Middleware::Base
  attr_accessor :prefix
  cast_to_string :prefix
  
  def start_tracker_segment(tracker_name)
    prefixed_name = [prefix.gsub(/_$/, ''), tracker_name]
    prefixed_name.reject!{|e| e.empty? }
    super(prefixed_name.join('_'))
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tracksperanto-2.9.5 lib/middleware/prefix.rb
tracksperanto-2.9.4 lib/middleware/prefix.rb
tracksperanto-2.9.3 lib/middleware/prefix.rb
tracksperanto-2.9.2 lib/middleware/prefix.rb
tracksperanto-2.9.1 lib/middleware/prefix.rb
tracksperanto-2.9.0 lib/middleware/prefix.rb