Sha256: 7d24fc850ab10d773f4094f75c134e8000fc266d06b0391a519d6f29fd700292

Contents?: true

Size: 354 Bytes

Versions: 4

Compression:

Stored size: 354 Bytes

Contents

module Ahoy
  class EventsController < Ahoy::BaseController

    def create
      options = {}
      if params[:time] and (time = Time.at(params[:time].to_f) rescue nil) and (1.minute.ago..Time.now).cover?(time)
        options[:time] = time
      end
      ahoy.track params[:name], params[:properties], options
      render json: {}
    end

  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
ahoy_matey-0.2.1 app/controllers/ahoy/events_controller.rb
ahoy_matey-0.2.0 app/controllers/ahoy/events_controller.rb
ahoy_events-0.1.1 app/controllers/ahoy/events_controller.rb
ahoy_events-0.1.0 app/controllers/ahoy/events_controller.rb