local_authority 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/local_authority.rb +8 -0
- data/lib/local_authority/version.rb +1 -1
- data/local_authority.gemspec +1 -1
- metadata +6 -6
data/lib/local_authority.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "local_authority/version"
|
2
|
+
require "my_society/map_it"
|
2
3
|
require "csv"
|
3
4
|
|
4
5
|
module LocalAuthority
|
@@ -16,6 +17,13 @@ module LocalAuthority
|
|
16
17
|
}
|
17
18
|
end
|
18
19
|
|
20
|
+
def self.find_by_postcode postcode
|
21
|
+
p = MySociety::MapIt::Postcode.new postcode
|
22
|
+
la = p.local_authority
|
23
|
+
return if la.nil?
|
24
|
+
find_by_map_it_id la.id
|
25
|
+
end
|
26
|
+
|
19
27
|
attr_accessor :attributes
|
20
28
|
private :attributes=
|
21
29
|
|
data/local_authority.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: local_authority
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
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-
|
12
|
+
date: 2012-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.0.
|
53
|
+
version: 0.0.5
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +58,7 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.0.
|
61
|
+
version: 0.0.5
|
62
62
|
description: Local authority information and links to further datasets
|
63
63
|
email:
|
64
64
|
- craig@barkingiguana.com
|
@@ -89,7 +89,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
89
|
version: '0'
|
90
90
|
segments:
|
91
91
|
- 0
|
92
|
-
hash:
|
92
|
+
hash: 1864126131329212725
|
93
93
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
version: '0'
|
99
99
|
segments:
|
100
100
|
- 0
|
101
|
-
hash:
|
101
|
+
hash: 1864126131329212725
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
104
|
rubygems_version: 1.8.24
|