This gem provides an {ActiveResource}[http://api.rubyonrails.org/classes/ActiveResource/Base.html]-based client to information on Avvo, a directory of lawyers.
Apart from the gems installed as dependencies, this gem requires an account on Avvo associated with an API key. Visit the API Documentation for details.
Somewhere during your app’s initialization, you should include the gem and set it up with your Avvo credentials:
require 'avvo_api' AvvoApi.setup('user@avvo.com', 'password')
For the most part, the models supplied by this gem should act like ActiveRecord models. These models parallel the resources listed on api.avvo.com, and everything accessible from the Avvo API is accessible using this gem.
Details about the specific information returned by these calls can be found in the documentation at api.avvo.com. An example of using the API in a command-line program can be found in the examples
subdirectory.
l = AvvoApi::Lawyer.find(28995)
l = AvvoApi::Lawyer.resolve(:name => 'Mark Britton', :zip_code => '98101')
AvvoApi::Lawyer.search(:q => 'criminal defense', :loc => 'seattle')
AvvoApi::Lawyer.find(28995).headshot.headshot_url
or
AvvoApi::Headshot.find(:one, :params => {:lawyer_id => 28995}).headshot_url
addresses = AvvoApi::Lawyer.find(28995).addresses
or
addresses = AvvoApi::Address.find(:all, :params => {:lawyer_id => lawyer.id})
main_address = AvvoApi::Address.main(:lawyer_id => lawyer.id)