jawbone-up 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/jawbone-up/session.rb +14 -1
  2. metadata +3 -2
@@ -65,6 +65,19 @@ module JawboneUP
65
65
  return_response result['data']
66
66
  end
67
67
 
68
+ # Return the the metadata for the last 7 days' sleep activity (note: not _actual_ sleep details)
69
+ def get_sleep_details
70
+ result = self.get "/nudge/api/users/@me/sleeps/"
71
+ return_response result['data']
72
+ end
73
+
74
+ # Return an array of arrays; each element includes the epoch and sleep state at that time
75
+ # sleep_xid is required and can be obtained via the data structure returned from #get_sleep_details
76
+ def get_sleep_snapshot( sleep_xid )
77
+ result = self.get "/nudge/api/sleeps/#{sleep_xid}/snapshot"
78
+ return_response result['data']
79
+ end
80
+
68
81
  # Return either a Hashie::Mash object or the raw hash depending on config variable
69
82
  def return_response(hash)
70
83
  @config.use_hashie_mash ? Hashie::Mash.new(hash) : hash
@@ -134,4 +147,4 @@ module JawboneUP
134
147
  headers
135
148
  end
136
149
  end
137
- end
150
+ end
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jawbone-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Aaron Parecki
9
+ - Ryan Frantz
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-06-15 00:00:00.000000000 Z
13
+ date: 2013-08-13 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: json