simple-mappr 0.0.7 → 0.0.8

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: f87e9c0da2b16a3cfac9b3402cc027d0f8097d28
4
- data.tar.gz: dab918a366c0c2996fc71f8805c55902800eb29e
3
+ metadata.gz: 5279d796f1799b338d41d29a9ad1975fd893dbe7
4
+ data.tar.gz: 15188cca04a9223f3cf0d46290bb1eed887cb864
5
5
  SHA512:
6
- metadata.gz: 377bcb3282c21b7bd008701bba0722ae7f61c7113537cdde05caa2db5508c311bbebcf7ee99f3377665dbd97f890b515b36b5f0d23a99ba2e599c8dae3f78a3d
7
- data.tar.gz: 4b1c1c89174e480f860c02decd77ddb120f11bb3919ba29fec85eefc4ddff219a1fe3c3a6d913a6e2e39207c2ba89b88915a909e38f0130225686d1a273e3367
6
+ metadata.gz: 62361c6b4a3295ca8a722afe8eab27d4b7de0461dcd34f0c724869ea42ee24b16cb3b73d38cd074b3678861b015f3812db7511b1d277bff187ac298f49402367
7
+ data.tar.gz: b7ef6be1a8086357d001e26222842d922c9881d4253eab80750bac45c8322bc089f23cff3df813bca1d04d98aef5e79bddb47f416fb1aee5d53878b9c4d3e03a
@@ -33,7 +33,7 @@ class SimpleMappr
33
33
  # == Example Output
34
34
  #
35
35
  # {
36
- # imageURL: "http://img.simplemappr.local/579273e6_1dd1_2.png",
36
+ # imageURL: "http://img.simplemappr.net/579273e6_1dd1_2.png",
37
37
  # expiry: "2016-07-22T21:28:38-04:00"
38
38
  # }
39
39
  #
@@ -381,6 +381,23 @@ class SimpleMappr
381
381
  @parameters[:width] || nil
382
382
  end
383
383
 
384
+ ##
385
+ # Include wkt regions as a Hash
386
+ # Specify color, title, and data as keys
387
+ #
388
+ # == Example
389
+ #
390
+ # instance.wkt = { color: "200,200,200", title: "My Regions", data: "POLYGON((-70 63,-70 48,-106 48,-106 63,-70 63))"}
391
+ #
392
+ def wkt=(wkt)
393
+ Validator.validate_wkt(wkt)
394
+ @parameters[:wkt] = wkt
395
+ end
396
+
397
+ def wkt
398
+ @parameters[:wkt] || nil
399
+ end
400
+
384
401
  ##
385
402
  # Specify a zoom level, centred on the geographic center of all points
386
403
  # Must be less than or eqaual to 10
@@ -142,5 +142,16 @@ class SimpleMappr
142
142
  end
143
143
  end
144
144
 
145
+ def self.validate_wkt(data)
146
+ validate_type(data, 'Array')
147
+ data.each { |item| validate_type(item, 'Hash') }
148
+ if !(data[0].keys - [:data, :title, :color]).empty?
149
+ raise InvalidParameterValue, "wkt must be an Array of Hashes in the form [{ data: \"\", title: \"\", color: \"\" }]"
150
+ end
151
+ if data[0].key?(:color)
152
+ validate_color(data[0][:color])
153
+ end
154
+ end
155
+
145
156
  end
146
157
  end
@@ -1,5 +1,5 @@
1
1
  class SimpleMappr
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-mappr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - David P. Shorthouse
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '9.0'
83
83
  description: A gem to access the SimpleMappr API
84
- email: 'davidpshorthouse@gmail.com '
84
+ email: davidpshorthouse@gmail.coms
85
85
  executables: []
86
86
  extensions: []
87
87
  extra_rdoc_files: []