horntell 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/horntell.rb +1 -0
- data/lib/horntell/app.rb +11 -4
- data/lib/horntell/campaign.rb +7 -5
- data/lib/horntell/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8b857c286d6ec2a8b1c3afc89cbf9daa1b563a7
|
4
|
+
data.tar.gz: eb0f7f62962d93858c40ebe9b32c51894675fd86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d652b75c69eaa846fd64c702cf0f36b858bd8fb42401deb0d823bc38d7a4f550d83bcf639253dd420b4de44bde9cc28d96a0d06d75ce6e982f0c999d3b367fd2
|
7
|
+
data.tar.gz: 3e48fb867e80847138151f9c0fb5ec6cd43f8e895c8f5a2dc8555c5b6c369a4f7c9dee0968aeb043c6ff50fb463bfc691992ce44411328f75de8c9f4d4fe5e88
|
data/README.md
CHANGED
data/lib/horntell.rb
CHANGED
data/lib/horntell/app.rb
CHANGED
@@ -14,13 +14,13 @@ module Horntell
|
|
14
14
|
|
15
15
|
# initializes the key and secret of the app
|
16
16
|
def self.init(key = nil, secret = nil)
|
17
|
-
@key = key
|
18
|
-
@secret = secret
|
17
|
+
@key = "#{key}"
|
18
|
+
@secret = "#{secret}"
|
19
19
|
end
|
20
20
|
|
21
21
|
# sets the base url of the app
|
22
22
|
def self.set_base(base = nil)
|
23
|
-
@base = base
|
23
|
+
@base = "#{base}"
|
24
24
|
end
|
25
25
|
|
26
26
|
# returns the base url of the app
|
@@ -40,7 +40,7 @@ module Horntell
|
|
40
40
|
|
41
41
|
# sets the version of the app
|
42
42
|
def self.set_version(version = nil)
|
43
|
-
@version = version
|
43
|
+
@version = "#{version}"
|
44
44
|
end
|
45
45
|
|
46
46
|
# gets the version of the app
|
@@ -48,5 +48,12 @@ module Horntell
|
|
48
48
|
return @version
|
49
49
|
end
|
50
50
|
|
51
|
+
#return hash hmac 256
|
52
|
+
def self.hash(uid)
|
53
|
+
sha256 = OpenSSL::Digest::SHA256.new
|
54
|
+
hash = OpenSSL::HMAC.hexdigest(sha256, @secret, "#{uid}")
|
55
|
+
|
56
|
+
return hash
|
57
|
+
end
|
51
58
|
end
|
52
59
|
end
|
data/lib/horntell/campaign.rb
CHANGED
@@ -3,15 +3,17 @@ module Horntell
|
|
3
3
|
extend Horntell::Http::Request
|
4
4
|
|
5
5
|
# triggers campaign for single profile
|
6
|
-
def self.to_profile(uid, campaignId)
|
7
|
-
|
6
|
+
def self.to_profile(uid, campaignId, meta = nil)
|
7
|
+
data = { :meta => meta }
|
8
|
+
|
9
|
+
return raw_request('post', "/profiles/#{uid}/campaigns/#{campaignId}", data)
|
8
10
|
end
|
9
11
|
|
10
12
|
#triggers campaign for multiple profile
|
11
|
-
def self.to_profiles(profiles, campaignId)
|
12
|
-
|
13
|
+
def self.to_profiles(profiles, campaignId, meta = nil)
|
14
|
+
data = { :profile_uids => profiles, :meta => meta }
|
13
15
|
|
14
|
-
return raw_request('post', "/profiles/campaigns/#{campaignId}",
|
16
|
+
return raw_request('post', "/profiles/campaigns/#{campaignId}", data)
|
15
17
|
end
|
16
18
|
end
|
17
19
|
end
|
data/lib/horntell/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: horntell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mohit Mamoria
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|