Class: Feather

Inherits:
Object
  • Object
show all
Defined in:
lib/feather-api.rb

Class Method Summary collapse

Class Method Details

.track(identifier, interaction, api_key) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/feather-api.rb', line 6

def self.track(identifier, interaction, api_key)
  uri = URI.parse("http://feather-cfm.com/api/v1/track/custom")
  header = {'Content-Type': 'text/json'}
  data = {
    'identifier' => identifier,
    'interaction' => interaction,
    'api_key' => api_key
  }

  http = Net::HTTP.new(uri.host, uri.port)
  request = Net::HTTP::Post.new(uri.request_uri, header)
  request.body = data.to_json

  response = http.request(request)
end