Sha256: c1ba59e76136706dfd21decb8799fdb618e9129b6ec686419a2c79c075258381

Contents?: true

Size: 411 Bytes

Versions: 10

Compression:

Stored size: 411 Bytes

Contents

class Rack::Tracker::Facebook < Rack::Tracker::Handler
  class Event < OpenStruct
    def write
      ['track', self.id, to_h.except(:id).compact].to_json
    end
  end

  self.position = :body

  def render
    Tilt.new( File.join( File.dirname(__FILE__), 'template/facebook.erb') ).render(self)
  end

  def self.track(name, *event)
    { name.to_s => [event.last.merge('class_name' => 'Event')] }
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rack-tracker-1.3.1 lib/rack/tracker/facebook/facebook.rb
rack-tracker-1.3.0 lib/rack/tracker/facebook/facebook.rb
rack-tracker-1.2.0 lib/rack/tracker/facebook/facebook.rb
rack-tracker-1.1.0 lib/rack/tracker/facebook/facebook.rb
rack-tracker-1.0.2 lib/rack/tracker/facebook/facebook.rb
rack-tracker-1.0.1 lib/rack/tracker/facebook/facebook.rb
rack-tracker-1.0.0 lib/rack/tracker/facebook/facebook.rb
rack-tracker-0.4.2 lib/rack/tracker/facebook/facebook.rb
rack-tracker-0.4.1 lib/rack/tracker/facebook/facebook.rb
rack-tracker-0.4.0 lib/rack/tracker/facebook/facebook.rb