sqed 0.1.1 → 0.1.2

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: f028e306ff2c2f95b9caaf8b1cfbc29416fce995
4
- data.tar.gz: 4e560b1fb92746dbfb61ee62183555eea10cfdab
3
+ metadata.gz: 15b9a6f76959bb89b1fbfbb521ec81418044e429
4
+ data.tar.gz: 9207ef009d4ef1c3ec0b286152a254ac5d5efd29
5
5
  SHA512:
6
- metadata.gz: a9c86658dcfecb19ac3529107637c51f313c9107fb38b801d1840932a7688eaf873e1b66674df99a7bec56ffcc662c2965b255e47d6eabd1f842fbd9efb746dd
7
- data.tar.gz: af43d2974fa17ab3ce6d5c0b1fd32af0ab87f417f3faffbc393b11b06b991dc29c72508dde58f81e701fbc840d02512d9a3c09dd2a94a5f1c50f4019fcdc1d09
6
+ metadata.gz: 3f1ab07c22d9651c0ec758c11e26e070ca9a6771089c6c0b6f27cb3cf3297c07e0052bd5d27db2ff7e622422fed9c5181072ef52eff244660280b008cb33f177
7
+ data.tar.gz: 97dee84567edca8f41a0ab193d0ccc577a637ba8cdf293d60c62df6b152d09ff0d08a0e7a61d4cddae4e487db403222c4827c46083ba15603169a8acb47f00f9
@@ -27,10 +27,13 @@ class Sqed::Extractor
27
27
  def result
28
28
  r = Sqed::Result.new()
29
29
 
30
+ r.sections = metadata_map.values.sort
31
+
30
32
  # assign the images to the result
31
33
  boundaries.each do |section_index, coords|
32
- image_setter = "#{metadata_map[section_index]}_image="
33
- r.send(image_setter, extract_image(coords))
34
+ section_type = metadata_map[section_index]
35
+ r.send("#{section_type}_image=", extract_image(coords))
36
+ r.boundary_coordinates[section_type] = coords
34
37
  end
35
38
 
36
39
  # assign the metadata to the result
data/lib/sqed/result.rb CHANGED
@@ -7,10 +7,18 @@ class Sqed::Result
7
7
  attr_accessor "#{k}_image".to_sym
8
8
  attr_accessor k
9
9
  end
10
+
11
+ # a hash with section_type => [ ]
12
+ attr_accessor :boundary_coordinates
13
+
14
+ # an array of section type
15
+ attr_accessor :sections
10
16
 
11
17
  def initialize
18
+ @boundary_coordinates = {}
12
19
  SqedConfig::LAYOUT_SECTION_TYPES.each do |k|
13
20
  send("#{k}=", {})
21
+ @boundary_coordinates[k] = [nil, nil, nil, nil]
14
22
  end
15
23
  end
16
24
 
data/lib/sqed/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Sqed
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -49,6 +49,21 @@ describe Sqed::Extractor do
49
49
  specify '#result is populated with text' do
50
50
  expect(r.text_for(:identifier)).to match('000085067')
51
51
  end
52
+
53
+ specify '#sections is populated with section_types' do
54
+ expect(r.sections).to eq( [ :identifier, :image_registration, :nothing, :specimen ] )
55
+ end
56
+
57
+ specify '#boundary_coordinates is populated with coordinates' do
58
+ metadata_map.values.each do |section_type|
59
+ (0..3).each do |i|
60
+ expect(r.boundary_coordinates[section_type][i]).to be_truthy
61
+ end
62
+ end
63
+ end
64
+
65
+
66
+
52
67
  end
53
68
 
54
69
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Yoder