simplificator-withings 0.2.4 → 0.2.5

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/README.rdoc CHANGED
@@ -18,7 +18,21 @@ will make an API call to populate the attributes, User.new just requires user_id
18
18
 
19
19
  == TODO
20
20
 
21
- * Integration Test? But i don't want to share my credentials... Perhaps with a test account on withings?
21
+ * Integration Test? But i don't want to share my credentials... Perhaps with a test account on withings? Solution from Withings support:
22
+ Hi,
23
+
24
+ The easiest is that you just create a regular account
25
+ (http://start.withings.com), associate it with one scale, then create a user
26
+ (like any regular customer).
27
+
28
+ Once this is done, the account is activated. You may then go to My
29
+ account/My scale and dissociate the scale, the account will stay opened.
30
+ That account may be used by who ever you think it should for test purposes
31
+ and will not be associated to a specific scale.
32
+
33
+ Thanks for your enquiry !
34
+
35
+ fred
22
36
 
23
37
  == Remarks
24
38
 
data/lib/withings/user.rb CHANGED
@@ -4,13 +4,13 @@ class Withings::User
4
4
  # Authenticate a user by email/password
5
5
  #
6
6
  def self.authenticate(email, password)
7
- response = Connection.get_request('/account', :action => :getuserslist, :email => email, :hash => auth_hash(email, password))
8
- User.new(response['users'].first)
7
+ response = Withings::Connection.get_request('/account', :action => :getuserslist, :email => email, :hash => auth_hash(email, password))
8
+ Withings::User.new(response['users'].first)
9
9
  end
10
10
 
11
11
  def self.info(user_id, public_key)
12
- response = Connection.get_request('/user', :action => :getbyuserid, :userid => user_id, :publickey => public_key)
13
- User.new(response['users'].first)
12
+ response = Withings::Connection.get_request('/user', :action => :getbyuserid, :userid => user_id, :publickey => public_key)
13
+ Withings::User.new(response['users'].first)
14
14
  end
15
15
 
16
16
 
@@ -41,7 +41,7 @@ class Withings::User
41
41
 
42
42
  def describe_notification(callback_url)
43
43
  response = connection.get_request('/notify', :action => :get, :callbackurl => callback_url)
44
- NotificationDescription.new(response.merge(:callbackurl => callback_url))
44
+ Withings::NotificationDescription.new(response.merge(:callbackurl => callback_url))
45
45
  end
46
46
 
47
47
 
@@ -69,7 +69,7 @@ class Withings::User
69
69
 
70
70
  response = connection.get_request('/measure', options.merge(:action => :getmeas))
71
71
  response['measuregrps'].map do |group|
72
- MeasurementGroup.new(group)
72
+ Withings::MeasurementGroup.new(group)
73
73
  end
74
74
  end
75
75
 
@@ -92,7 +92,7 @@ class Withings::User
92
92
  protected
93
93
 
94
94
  def connection
95
- @connection ||= Connection.new(self)
95
+ @connection ||= Withings::Connection.new(self)
96
96
  end
97
97
 
98
98
  def self.auth_hash(email, password)
@@ -101,7 +101,7 @@ class Withings::User
101
101
  end
102
102
 
103
103
  def self.once()
104
- Connection.get_request('/once', :action => :get)['once']
104
+ Withings::Connection.get_request('/once', :action => :get)['once']
105
105
  end
106
106
 
107
107
  # convert from boolean (@share) to 1/0 as required by the API
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{simplificator-withings}
5
- s.version = "0.2.4"
5
+ s.version = "0.2.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["pascalbetz"]
9
- s.date = %q{2010-08-05}
9
+ s.date = %q{2010-08-17}
10
10
  s.description = %q{A withings API implementation in ruby. Created for the evita project}
11
11
  s.email = %q{info@simplificator.com}
12
12
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplificator-withings
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - pascalbetz
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-05 00:00:00 +02:00
18
+ date: 2010-08-17 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency