medic 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 885ef7d6a312a5644cf27850d9bb01fc24e5bcaa
4
- data.tar.gz: 41f408b021b7b03bcab32b2eca082274439b7c9e
3
+ metadata.gz: eda3e2d7ba2a313d6a7eaec4e2d2934b2e367ec7
4
+ data.tar.gz: 1ed32fdf3755a976414a4ae15f92ac4ed34ec0a5
5
5
  SHA512:
6
- metadata.gz: 1a6b3e8f52c4338cbb9de50165fde57c559f41136e141776a9794544bbbd37bf005d156ef84482150f4d253b7f22dc06b3e883917bae28df256296fc43d9568b
7
- data.tar.gz: f3372641785e97bf22028ec8a90c22a9bb6f2f1fffe076fed282e96beda379d55a3a3929be7e8c77647cecfda8383b399d00e8f15d1a52bae2801dc53b270c6f
6
+ metadata.gz: 463ddcc6163b50606725fa5e6a662ce8a2a1fab9b2a8effc0d88fc658af4d1d6bcf8c3990a448366e7c24f1a154282ff59d482194cd65bca626c66a704713aae
7
+ data.tar.gz: 7bcb608105024d674773e25a6fbe3b554910c35acc9a9f8638e69c3272b1faef8f668a1bc179b84af8dd64b526bc5c456536a6115e37e0e59471d6f26b2323d4
@@ -13,6 +13,7 @@ module Medic
13
13
  def anchor_for_symbol(sym)
14
14
  return unless sym
15
15
  return sym if sym.to_s == '0'
16
+ return sym if sym.is_a? Fixnum
16
17
  return sym if sym.is_a? NSDate
17
18
  parts = sym.to_s.gsub('_', ' ').split.reject{ |part| part == 'ago' }
18
19
  component = parts.pop.chomp('s')
@@ -77,21 +77,21 @@ module Medic
77
77
  h[:source] = sample.source.name
78
78
  h[:start_date] = sample.startDate
79
79
  h[:end_date] = sample.endDate
80
- h[:sample_type] = Medic::Types::TYPE_IDENTIFIERS.index(sample.sampleType.identifier)
80
+ h[:sample_type] = Medic::Types::TYPE_IDENTIFIERS.key(sample.sampleType.identifier)
81
81
 
82
82
  if sample.respond_to?(:categoryType) && sample.respond_to?(:value)
83
- h[:category_type] = Medic::Types::TYPE_IDENTIFIERS.index(sample.categoryType.identifier)
83
+ h[:category_type] = Medic::Types::TYPE_IDENTIFIERS.key(sample.categoryType.identifier)
84
84
  h[:value] = [:in_bed, :asleep][sample.value] # SleepAnalysis is the only category type at the moment
85
85
  end
86
86
 
87
87
  if sample.respond_to?(:correlationType) && sample.respond_to?(:objects)
88
- h[:correlation_type] = Medic::Types::TYPE_IDENTIFIERS.index(sample.correlationType.identifier)
88
+ h[:correlation_type] = Medic::Types::TYPE_IDENTIFIERS.key(sample.correlationType.identifier)
89
89
  h[:objects] = samples_to_hashes(Array(sample.objects.allObjects))
90
90
  end
91
91
 
92
92
  if sample.respond_to?(:quantity) && sample.respond_to?(:quantityType)
93
93
  h[:quantity] = sample.quantity.doubleValueForUnit(sample.quantityType.canonicalUnit)
94
- h[:quantity_type] = Medic::Types::TYPE_IDENTIFIERS.index(sample.quantityType.identifier)
94
+ h[:quantity_type] = Medic::Types::TYPE_IDENTIFIERS.key(sample.quantityType.identifier)
95
95
  h[:canonical_unit] = sample.quantityType.canonicalUnit.unitString
96
96
  end
97
97
 
@@ -109,7 +109,7 @@ module Medic
109
109
  h[:start_date] = stats.startDate
110
110
  h[:end_date] = stats.endDate
111
111
  h[:sources] = stats.sources.map(&:name) if stats.sources
112
- h[:quantity_type] = Medic::Types::TYPE_IDENTIFIERS.index(stats.quantityType.identifier)
112
+ h[:quantity_type] = Medic::Types::TYPE_IDENTIFIERS.key(stats.quantityType.identifier)
113
113
  h[:canonical_unit] = stats.quantityType.canonicalUnit.unitString
114
114
  h[:data_count] = stats.dataCount
115
115
  h[:average] = stats.averageQuantity.doubleValueForUnit(stats.quantityType.canonicalUnit) if stats.averageQuantity
@@ -1,3 +1,3 @@
1
1
  module Medic
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Linton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-18 00:00:00.000000000 Z
11
+ date: 2016-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -104,7 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  version: '0'
105
105
  requirements: []
106
106
  rubyforge_project:
107
- rubygems_version: 2.4.6
107
+ rubygems_version: 2.5.2
108
108
  signing_key:
109
109
  specification_version: 4
110
110
  summary: A RubyMotion Wrapper for HealthKit