my_society-map_it 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module MySociety
2
2
  module MapIt
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
@@ -41,6 +41,12 @@ module MySociety
41
41
  attr_accessor :attributes
42
42
  private :attributes=, :attributes
43
43
 
44
+ def self.find uri
45
+ u = URI.parse uri
46
+ r = Net::HTTP.get_response u
47
+ new JSON.parse r.body
48
+ end
49
+
44
50
  def initialize attributes
45
51
  self.attributes = attributes
46
52
  end
@@ -52,6 +58,10 @@ module MySociety
52
58
  def id
53
59
  attributes['id']
54
60
  end
61
+
62
+ def uri
63
+ [ MySociety::MapIt.base_url, 'area', id ].join '/'
64
+ end
55
65
  end
56
66
 
57
67
  class Point
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: my_society-map_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-07 00:00:00.000000000 Z
12
+ date: 2012-10-13 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: API for MySociety's MapIt service
15
15
  email: