Sha256: 5f64e255e823b4216bcbcf68e4dc327b7525aa613f6d364c9ef6458825e3cba1

Contents?: true

Size: 420 Bytes

Versions: 55

Compression:

Stored size: 420 Bytes

Contents

# 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

55 entries across 55 versions & 1 rubygems

Version Path
tracksperanto-2.8.6 lib/middleware/prefix.rb
tracksperanto-2.8.5 lib/middleware/prefix.rb
tracksperanto-2.8.4 lib/middleware/prefix.rb
tracksperanto-2.8.2 lib/middleware/prefix.rb
tracksperanto-2.8.1 lib/middleware/prefix.rb
tracksperanto-2.8.0 lib/middleware/prefix.rb
tracksperanto-2.7.0 lib/middleware/prefix.rb
tracksperanto-2.6.3 lib/middleware/prefix.rb
tracksperanto-2.6.2 lib/middleware/prefix.rb
tracksperanto-2.6.1 lib/middleware/prefix.rb
tracksperanto-2.6.0 lib/middleware/prefix.rb
tracksperanto-2.5.0 lib/middleware/prefix.rb
tracksperanto-2.4.1 lib/middleware/prefix.rb
tracksperanto-2.3.3 lib/middleware/prefix.rb
tracksperanto-2.3.2 lib/middleware/prefix.rb
tracksperanto-2.3.1 lib/middleware/prefix.rb
tracksperanto-2.3.0 lib/middleware/prefix.rb
tracksperanto-2.2.4 lib/middleware/prefix.rb
tracksperanto-2.2.2 lib/middleware/prefix.rb
tracksperanto-2.2.0 lib/middleware/prefix.rb