feather-api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/feather-api.rb +21 -0
  3. metadata +44 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6e00dafd41b28438377794553171cf9f53afe5f1
4
+ data.tar.gz: 2d3548a48c8a3bdfed8dfb92658874c63b24f191
5
+ SHA512:
6
+ metadata.gz: 1b1ef9cac8b2bbc2816550b30fef97b9555645bbc1b863c76a495aade831396d2bad6bc6a08138b085a562b7af0bf0baef70cae1c1be3f9ac259e772301bde66
7
+ data.tar.gz: b1b05b1f0e42b1424b6fe9768f859e801ffae552a8142ae86d08ae9f9e56d7c6ce133a651a11c4826c1f05c1bd0f657b3081c971bc5e85833ea142095bfd03e3
@@ -0,0 +1,21 @@
1
+ require 'net/http'
2
+ require 'uri'
3
+ require 'json'
4
+
5
+ class Feather
6
+ def self.track(identifier, interaction, api_key)
7
+ uri = URI.parse("http://feather-cfm.com/api/v1/track/custom")
8
+ header = {'Content-Type': 'text/json'}
9
+ data = {
10
+ 'identifier' => identifier,
11
+ 'interaction' => interaction,
12
+ 'api_key' => api_key
13
+ }
14
+
15
+ http = Net::HTTP.new(uri.host, uri.port)
16
+ request = Net::HTTP::Post.new(uri.request_uri, header)
17
+ request.body = data.to_json
18
+
19
+ response = http.request(request)
20
+ end
21
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: feather-api
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Feather
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-11-24 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby library for the Feather API
14
+ email: hello@feather-cfm.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/feather-api.rb
20
+ homepage: http://rubygems.org/gems/feather-api
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.5.1
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Ruby library for the Feather API
44
+ test_files: []