my_zeo 0.2.2 → 0.4.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.
- data/lib/my_zeo.rb +28 -0
- metadata +5 -5
data/lib/my_zeo.rb
CHANGED
@@ -6,12 +6,40 @@ class MyZeo
|
|
6
6
|
base_uri "https://api.myzeo.com:8443/zeows/api/v1/sleeperService"
|
7
7
|
|
8
8
|
attr_reader :api_key
|
9
|
+
attr_reader :user_id
|
9
10
|
|
10
11
|
def initialize(api_key,opts={})
|
11
12
|
@api_key = api_key
|
13
|
+
@user_id = opts[:user_id] ? opts[:user_id] : nil
|
12
14
|
MyZeo.basic_auth opts[:login], opts[:password] if (opts[:login] && opts[:password])
|
13
15
|
MyZeo.base_uri opts[:base_url] if opts[:base_url]
|
14
16
|
end
|
17
|
+
|
18
|
+
# Currently Staging API
|
19
|
+
# *************************************************************************************************************************************
|
20
|
+
def subscribe_to_notify_link(callback_url)
|
21
|
+
"#{self.class.base_uri}/subscribeToNotify?key=#{@api_key}&userid=#{@user_id}&callback=#{callback_url}"
|
22
|
+
end
|
23
|
+
|
24
|
+
def unsubscribe_to_notify_link
|
25
|
+
"#{self.class.base_uri}/unsubscribeToNotify?key=#{@api_key}&userid=#{@user_id}"
|
26
|
+
end
|
27
|
+
|
28
|
+
def unsubscribe_to_notify
|
29
|
+
MyZeo.get("/unsubscribeToNotify?key=#{@api_key}", :query => {:userid => @user_id}).recursive_symbolize_keys!
|
30
|
+
end
|
31
|
+
|
32
|
+
def get_bulk_sleep_stats_since_date(opts={})
|
33
|
+
date = opts[:date] ? opts[:date] : ""
|
34
|
+
MyZeo.get("/getBulkSleepStatsSinceDate?key=#{@api_key}", :query => {:userid => @user_id, :date => date }).recursive_symbolize_keys!
|
35
|
+
end
|
36
|
+
|
37
|
+
def get_bulk_sleep_records_since_date(opts={})
|
38
|
+
date = opts[:date] ? opts[:date] : ""
|
39
|
+
MyZeo.get("/getBulkSleepRecordsSinceDate?key=#{@api_key}", :query => {:userid => @user_id, :date => date }).recursive_symbolize_keys!
|
40
|
+
end
|
41
|
+
|
42
|
+
# *************************************************************************************************************************************
|
15
43
|
|
16
44
|
def get_overall_average_zq_score
|
17
45
|
MyZeo.get("/getOverallAverageZQScore?key=#{@api_key}").recursive_symbolize_keys!
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_zeo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 0.4.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Haris Amin
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-11-
|
18
|
+
date: 2010-11-17 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|