Sha256: e1d88ff28f33e9ae1f910357cfe6ede5e2078c79f277bf5a8f149d7472386aec

Contents?: true

Size: 493 Bytes

Versions: 1

Compression:

Stored size: 493 Bytes

Contents

# -*- encoding : utf-8 -*-

module Dito
  def self.track options = {}
    Dito.symbolize_keys!(options)

    id, id_type = Dito.generate_credentials(options)
    
    return { :error => { :message => 'Missing the user id param. See the available options here: http://developers.dito.com.br/docs/sdks/ruby' } } if id.blank?

    params = { :event => options[:event].to_json }
    params[:id_type] = id_type if id_type.present?

    Dito::Request.post 'events', "/users/#{id}/", params
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dito-0.0.4 lib/dito/track.rb