pat 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +30 -3
- data/VERSION +1 -1
- data/pat.gemspec +1 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -2,28 +2,55 @@
|
|
2
2
|
|
3
3
|
Get information on UK postcodes like this:
|
4
4
|
|
5
|
-
#
|
6
|
-
|
5
|
+
# Install the gem
|
6
|
+
|
7
|
+
sudo gem install pat
|
8
|
+
|
9
|
+
# Include the gem in your project
|
10
|
+
|
11
|
+
require 'pat'
|
7
12
|
|
8
13
|
# Request a postcode
|
9
|
-
|
14
|
+
|
15
|
+
@postcode = Pat.get("N1 1AA")
|
10
16
|
|
11
17
|
# Use the results
|
18
|
+
|
12
19
|
puts @postcode["geo"]["lat"]
|
20
|
+
|
13
21
|
puts @postcode["geo"]["lng"]
|
22
|
+
|
14
23
|
puts @postcode["geo"]["easting"]
|
24
|
+
|
15
25
|
puts @postcode["geo"]["northing"]
|
26
|
+
|
16
27
|
puts @postcode["geo"]["geohash"]
|
28
|
+
|
17
29
|
puts @postcode["administrative"]
|
30
|
+
|
18
31
|
puts @postcode["administrative"]["district"]
|
32
|
+
|
19
33
|
puts @postcode["administrative"]["district"]["title"]
|
34
|
+
|
20
35
|
puts @postcode["administrative"]["district"]["uri"]
|
36
|
+
|
21
37
|
puts @postcode["administrative"]["ward"]
|
38
|
+
|
22
39
|
puts @postcode["administrative"]["ward"]["title"]
|
40
|
+
|
23
41
|
puts @postcode["administrative"]["ward"]["uri"]
|
42
|
+
|
24
43
|
puts @postcode["postcode"]
|
25
44
|
|
26
45
|
|
46
|
+
# Try it out
|
47
|
+
|
48
|
+
irb -r rubygems -r pat
|
49
|
+
|
50
|
+
p = Pat.get(<your postcode>)
|
51
|
+
p["geo"]
|
52
|
+
p[""]
|
53
|
+
|
27
54
|
== Note on Patches/Pull Requests
|
28
55
|
|
29
56
|
* Fork the project.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/pat.gemspec
CHANGED