medic 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/lib/medic/anchor.rb +1 -0
- data/lib/medic/finders.rb +5 -5
- data/lib/medic/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eda3e2d7ba2a313d6a7eaec4e2d2934b2e367ec7
|
4
|
+
data.tar.gz: 1ed32fdf3755a976414a4ae15f92ac4ed34ec0a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 463ddcc6163b50606725fa5e6a662ce8a2a1fab9b2a8effc0d88fc658af4d1d6bcf8c3990a448366e7c24f1a154282ff59d482194cd65bca626c66a704713aae
|
7
|
+
data.tar.gz: 7bcb608105024d674773e25a6fbe3b554910c35acc9a9f8638e69c3272b1faef8f668a1bc179b84af8dd64b526bc5c456536a6115e37e0e59471d6f26b2323d4
|
data/lib/medic/anchor.rb
CHANGED
@@ -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')
|
data/lib/medic/finders.rb
CHANGED
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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
|
data/lib/medic/version.rb
CHANGED
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.
|
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:
|
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.
|
107
|
+
rubygems_version: 2.5.2
|
108
108
|
signing_key:
|
109
109
|
specification_version: 4
|
110
110
|
summary: A RubyMotion Wrapper for HealthKit
|