Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added calls to new getMLAs and getMSPs API methods. They are for memb…

…ers of the Northern Irish assembly and the Scottish Parliament respectively.
  • Loading branch information...
commit f1f009cf6b69f129002d66b8ef52646191734d8a 1 parent 9643267
Martin Owen authored
Showing with 28 additions and 5 deletions.
  1. +7 −1 History.txt
  2. +1 −1  Rakefile
  3. +11 −2 lib/twfy.rb
  4. +9 −1 test/test_twfy.rb
View
8 History.txt
@@ -1,3 +1,9 @@
+== 1.1.0 / 2008-08-02
+
+* Added support for new features of TWFY API (still version 1.0.0).
+ * getMLAs - Members of the Legislative Assembly (Members of the Northern Irish Assembly to you and me)
+ * getMSPs - Members of the Scottish Parliament
+
== 1.0.0 / 2006-11-08
* Initial release supporting all services from TWFY API 1.0.0
@@ -7,4 +13,4 @@
* Coming up:
* Easy pagination of debates, comments, etc
* Data mining MPInfo information (ie expenses, accessible directly from MP instance)
- * Other stuff :-)
+ * Other stuff :-)
View
2  Rakefile
@@ -16,7 +16,7 @@ EOD
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")
p.extra_deps = ['json', 'paginator']
p.email = %q{bruce@codefluency.com}
- p.author = ["Bruce Williams", "Martin Owens"]
+ p.author = ["Bruce Williams", "Martin Owen"]
end
# vim: syntax=Ruby
View
13 lib/twfy.rb
@@ -1,3 +1,4 @@
+require 'rubygems'
require 'open-uri'
require 'json'
require 'cgi'
@@ -8,7 +9,7 @@
module Twfy
- VERSION = '1.0.0'
+ VERSION = '1.1.0'
BASE = URI.parse('http://www.theyworkforyou.com/api/')
API_VERSION = '1.0.0'
@@ -61,6 +62,14 @@ def lords(params={})
service :getLords, validate(params, :allow => [:date, :search])
end
+ def mlas(params={})
+ service :getMLAs, validate(params, :allow => [:date, :party, :search])
+ end
+
+ def msps(params={})
+ service :getMSPs, validate(params, :allow => [:date, :party, :search])
+ end
+
def geometry(params={})
service :getGeometry, validate(params, :allow => :name), Geometry
end
@@ -170,4 +179,4 @@ def build_query(params)
end
-end
+end
View
10 test/test_twfy.rb
@@ -26,6 +26,14 @@ def test_mps
assert_kind_of Twfy::MP, mp
end
end
+
+ def test_msps
+ msps = @client.msps
+ assert_kind_of Array, msps
+ msps.each do |msp|
+ assert_kind_of OpenStruct, msp
+ end
+ end
def test_constituency_and_geometry
c = @client.constituency(:postcode => 'IP6 9PN')
@@ -41,4 +49,4 @@ def test_constituencies
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.