WeThePeople
we_the_people
is a gem to access the new We The People petitions API.
Quickstart
Here are a few example calls:
>> petition = WeThePeople::Resources::Petition.find("1234")
>> petition.body
# => "Example body"
>> petition.title
# => "My Example Petition"
>> petition.issues.first.name
# => "Civil Rights"
>> petitions = WeThePeople::Resources::Petition.all
>> petition2 = petitions.first
# Not yet implemented in the API (signatures)...
>> petition2.signatures.all.first.city
# => "Orlando"
Configuration
You can configure a few options on the WeThePeople
module:
-
api_key
- Your We The People API key (optional). -
default_page_size
- The page size to request by default for all resources. -
client
- If you don't want to userest-client
you can substitute in another HTTP client object that conforms to the same API here. -
mock
- If set to "1", all requests will return mock results.
Contributing
Hack some code, make a pull request. I'll review it and merge it in! Need some ideas as to where to get started? Here are a few:
- Tests. Please?
- Make resources be able to be related + associated. It looks like responses may end up going this route.
- Documentationages.