Sha256: 2b047f132f9febbcfbd50b5b9b0fa0a9e7980bc2d4d31e3965e6272d41235ef6
Contents?: true
Size: 563 Bytes
Versions: 18
Compression:
Stored size: 563 Bytes
Contents
require 'liquid/tracker/json_serializer' module Tracker class Base attr_accessor :dimensions def initialize(dimensions = {}) @dimensions = dimensions end def with_topic(topic, serializer = nil) Topic.new(topic, self, serializer) end end class Topic def initialize(topic, tracker, serializer = nil) @topic = topic @tracker = tracker @serializer = (serializer || JsonSerializer).new(tracker.dimensions) end def event(obj) @tracker.event(@topic, @serializer.dump(obj)) end end end
Version data entries
18 entries across 18 versions & 1 rubygems