everypolitician / everypolitician-popolo

Ruby gem for interacting with EveryPolitician data for a legislature
MIT License
7 stars 4 forks source link

Add method for returning all Email|Facebook|Twitter info #36

Open chrismytton opened 8 years ago

chrismytton commented 8 years ago

Problem

As part of https://github.com/everypolitician/everypolitician/issues/467 we need to access a list of Email|Facebook|Twitter information for the most recent term in a given legislature.

Proposed Solution

We should add methods to return all of the Email|Facebook|Twitter information for a given term in a given legislature. It probably makes sense for this to be more than just the string version of the handle, e.g. perhaps each element should be a Hash with at least the id of the original record.

Acceptance Criteria

I should be able to get a list of all Email|Facebook|Twitter information for a specific term in a legislature.

Not Required

Prerequisites

tmtmtmtm commented 8 years ago

@chrismytton I'm having a bit of difficulty working out what sort of interface you're expecting here.

"all of the Email|Facebook|Twitter information for a given term in a given legislature" sounds like you're expecting something like house_of_commons.terms.first.facebook which seems odd to me.

In terms of what we need for https://github.com/everypolitician/everypolitician/issues/467, would it be enough to do something akin to house_of_commons.terms.first.members.select(&:facebook).count?

That presupposes a term.members or equivalent, though, which makes me think there should have been a dependency on #40 added here when that was split out from #35 …