Sha256: 6c385a5b418a1cdedccb9225a5e1ae234bbb841d0a5a3a95e173a0754412eed0

Contents?: true

Size: 442 Bytes

Versions: 1

Compression:

Stored size: 442 Bytes

Contents

require 'liquid/tracker/json_serializer'

module Tracker
  class Base
    attr_accessor :serializer

    def initialize(dimensions = {})
      @serializer = JsonSerializer.new(dimensions)
    end

    def with_topic(topic)
      Topic.new(topic, self)
    end
  end

  class Topic
    def initialize(topic, tracker)
      @topic = topic
      @tracker = tracker
    end

    def event(obj)
      @tracker.event(obj, @topic)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
liquid-ext-3.0.0 lib/liquid/tracker/base.rb