spatial_features 2.1.2 → 2.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fe6423c43a010da714c64c92884e35f110bd1c11
4
- data.tar.gz: f5a7f15443fb26926fb3d078e138eb08c8e85cac
3
+ metadata.gz: 161e05dd5050ab333151fad1b7ec795e3f7586dd
4
+ data.tar.gz: 64e96f4e2f77c54db017c31e0d7babcce42015ba
5
5
  SHA512:
6
- metadata.gz: b5b64ae60b791edfb2c67e5d9ecb906f836824453a2a260e9e7b671657bfd2ed327283ab9d336e8159e87178eb7c8dc2a1bc486e0c72844ae20e8ff4008db0aa
7
- data.tar.gz: 942f676d7d558be9558a2cf2c46b3d9e6ace299b8be75e33f353abbcd03f17cd003152a2012a627f2d5ad3fc58371f0da4849ca07770c57c02573e599b06a41c
6
+ metadata.gz: 42339e9b2190d5ad0b88a5823140b70febf158de17978822598799d22ad46e0276f76d28c1289599acfd24e7fd36d2c946e0bb2e09f1e43e37c48f6feb2c4c7f
7
+ data.tar.gz: 52bb8cfed4a5728f997e8f0cbb7b6ededf330e1f7dbf1ce6478b7306556f802165a3746e6ba8a1e9f626c541e93138636984b23af998658aa021c34b2e792b04
@@ -7,8 +7,6 @@ module SpatialFeatures
7
7
 
8
8
  include InstanceMethods
9
9
  extend ClassMethods
10
-
11
- delegate :update_fusion_table, :delete_fusion_table, :fusion_table_id_cache, :to => self
12
10
  end
13
11
  end
14
12
 
@@ -17,14 +15,14 @@ module SpatialFeatures
17
15
  sanitize_sql(["spatial_model_id IN (?)", pluck(:id)])
18
16
  end
19
17
 
20
- def update_fusion_tables
21
- fusion_table_groups do |fusion_table_id, records, group_features|
18
+ def update_fusion_tables(group_options = {})
19
+ fusion_table_groups(group_options) do |fusion_table_id, records, group_features|
22
20
  API.set_features(fusion_table_id, group_features, :colour => fusion_table_features_options[:colour])
23
21
  end
24
22
  end
25
23
 
26
- def delete_fusion_tables
27
- fusion_table_groups do |fusion_table_id, records, group_features|
24
+ def delete_fusion_tables(group_options = {})
25
+ fusion_table_groups(group_options) do |fusion_table_id, records, group_features|
28
26
  API.delete_table(fusion_table_id)
29
27
  end
30
28
  fusion_table_id_cache.clear
@@ -42,8 +40,10 @@ module SpatialFeatures
42
40
 
43
41
  private
44
42
 
45
- def fusion_table_groups
43
+ def fusion_table_groups(only: [], except: [])
46
44
  all.group_by(&:fusion_table_id).each do |fusion_table_id, records|
45
+ next if only.present? && !Array.wrap(only).include?(fusion_table_id)
46
+ next if except.present? && Array.wrap(except).include?(fusion_table_id)
47
47
  yield fusion_table_id, records, features.where(:spatial_model_id => records)
48
48
  end
49
49
  end
@@ -54,8 +54,16 @@ module SpatialFeatures
54
54
  true
55
55
  end
56
56
 
57
+ def update_fusion_table
58
+ self.class.update_fusion_tables(only: fusion_table_id)
59
+ end
60
+
61
+ def delete_fusion_table
62
+ self.class.delete_fusion_tables(only: fusion_table_id)
63
+ end
64
+
57
65
  def fusion_table_id
58
- fusion_table_id_cache[fusion_table_name]
66
+ self.class.fusion_table_id_cache[fusion_table_name]
59
67
  end
60
68
 
61
69
  def fusion_table_name
@@ -1,3 +1,3 @@
1
1
  module SpatialFeatures
2
- VERSION = "2.1.2"
2
+ VERSION = "2.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spatial_features
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Wallace