At the moment, to pass a house to a Page constructor, we have to do a bit of a dance like this:
subject do
country = index_at_known_sha.country('united-states-of-america')
house = country.legislature('senate')
Page::HouseDownload.new(
house: house,
index: index_at_known_sha
)
end
This adds a bit of complexity and raises the flog score a bit.
Proposed Solution
It would be nice if we could add a method to the lib/everypolitician_extensions.rb to extend the Everypolitician::Index with a method that allows you to pass a country and a house slug.
module IndexExtension
def legislature(country_slug, legislature_slug)
# ...
end
end
Problem
At the moment, to pass a house to a Page constructor, we have to do a bit of a dance like this:
This adds a bit of complexity and raises the flog score a bit.
Proposed Solution
It would be nice if we could add a method to the
lib/everypolitician_extensions.rb
to extend theEverypolitician::Index
with a method that allows you to pass a country and a house slug.So that you can do
Acceptance Criteria