simplificator-withings 0.2.3 → 0.2.4

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.
@@ -14,7 +14,7 @@ class Withings::MeasurementGroup
14
14
  TYPE_FAT_MASS_WEIGHT = 8
15
15
 
16
16
  attr_reader :group_id, :attribution, :created_at, :category
17
- attr_reader :weight, :height, :fat, :ratio, :fat_free
17
+ attr_reader :weight, :size, :fat, :ratio, :fat_free
18
18
  def initialize(params)
19
19
  params = params.stringify_keys
20
20
  @group_id = params['grpid']
@@ -25,7 +25,7 @@ class Withings::MeasurementGroup
25
25
  value = (measure['value'] * 10 ** measure['unit']).to_f
26
26
  case measure['type']
27
27
  when TYPE_WEIGHT then @weight = value
28
- when TYPE_SIZE then @height = value
28
+ when TYPE_SIZE then @size = value
29
29
  when TYPE_FAT_MASS_WEIGHT then @fat = value
30
30
  when TYPE_FAT_RATIO then @ratio = value
31
31
  when TYPE_FAT_FREE_MASS_WEIGHT then @fat_free = value
@@ -42,14 +42,8 @@ class Withings::MeasurementGroup
42
42
  self.category == CATEGORY_TARGET
43
43
  end
44
44
 
45
- def bmi
46
- if self.height && self.weight
47
- self.weight / (self.height ** 2)
48
- end
49
- end
50
-
51
45
  def to_s
52
- "[ Weight: #{self.weight}, Fat: #{self.fat}, Height: #{self.height}, BMI: #{self.bmi}, Ratio: #{self.ratio}, Free: #{self.fat_free}, ID: #{self.group_id}]"
46
+ "[ Weight: #{self.weight}, Fat: #{self.fat}, Size: #{self.size}, Ratio: #{self.ratio}, Free: #{self.fat_free}, ID: #{self.group_id}]"
53
47
  end
54
48
 
55
49
  def inspect
@@ -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.3"
5
+ s.version = "0.2.4"
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-03}
9
+ s.date = %q{2010-08-05}
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: 17
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 3
10
- version: 0.2.3
9
+ - 4
10
+ version: 0.2.4
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-03 00:00:00 +02:00
18
+ date: 2010-08-05 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency