amberlock 0.0.1 → 0.0.2
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.
- data/lib/amberlock.rb +15 -13
- data/lib/amberlock/version.rb +1 -1
- metadata +1 -1
data/lib/amberlock.rb
CHANGED
@@ -1,21 +1,23 @@
|
|
1
1
|
require "amberlock/version"
|
2
2
|
|
3
|
-
|
3
|
+
module Amberlock
|
4
|
+
class Amber
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
def initialize(api_key, amber_code)
|
7
|
+
@api_key = api_key
|
8
|
+
@amber_code = amber_code
|
9
|
+
@subscribe_url = 'http://amberlock.herokuapp.com/api/amber_users'
|
10
|
+
@request_unlock_url = 'http://amberlock.herokuapp.com/api/unlock'
|
11
|
+
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
def subscribe_user(mobile, email)
|
14
|
+
RestClient.post "#{@subscribe_url}", "api_key=#{@api_key}&amber_code=#{@amber_code}&mobile=#{mobile}&email=#{email}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def request_unlock(mobile, email)
|
18
|
+
RestClient.post "#{@request_unlock_url}", "api_key=#{@api_key}&amber_code=#{@amber_code}&mobile=#{mobile}&email=#{email}"
|
19
|
+
end
|
15
20
|
|
16
|
-
def request_unlock(mobile, email)
|
17
|
-
RestClient.post "#{@request_unlock_url}", "api_key=#{@api_key}&amber_code=#{@amber_code}&mobile=#{mobile}&email=#{email}"
|
18
21
|
end
|
19
22
|
|
20
23
|
end
|
21
|
-
|
data/lib/amberlock/version.rb
CHANGED