README.md in fullcontact-0.10.0 vs README.md in fullcontact-0.11.0
- old
+ new
@@ -7,10 +7,11 @@
[![Code Climate](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby/badges/gpa.svg)](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby)
[![Test Coverage](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby/badges/coverage.svg)](https://codeclimate.com/github/fullcontact/fullcontact-api-ruby)
Changes
-------
+- 0.11.0 - Plisskin transformation can be disabled by specifying a `skip_rubyize = true` in config block.
- 0.10.0 - Support for FullContact Company API
- 0.9.0 - Removed Rash gem and replaced with Mashify + Plisskin
- 0.8.2 - Fix for 0.8.0 constant resolution issue.
- 0.8.0
- Hashie now allowed from [2.2, 4.0) to support a wide range of other applications
@@ -29,57 +30,89 @@
[http://rdoc.info/gems/fullcontact](http://rdoc.info/gems/fullcontact)
Usage Examples
--------------
```ruby
- require "fullcontact"
+ require 'fullcontact'
# This could go in an initializer
FullContact.configure do |config|
- config.api_key = "fullcontact_api_key_goes_here"
+ config.api_key = 'fullcontact_api_key_goes_here'
end
# Get information about an email address
- person = FullContact.person(email: "brawest@gmail.com")
-
+ person = FullContact.person(email: 'bart@fullcontact.com')
+```
+All returned values are Hashie structs. You can access fields as if they were fields:
+
+```ruby
+ # Get person's family_name
+ person.contact_info.family_name
+ => "Lorang"
+```
+
+But you can also turn it into a normal hash
+
+```ruby
+ # Get person's family_name
+ person.to_hash['contact_info']['family_name']
+ => "Lorang"
+```
+
+There's other ways you can query the Person API:
+```ruby
# Get information about an email address, organized by hashes vs. lists
- person2 = FullContact.person(email: "bart@fullcontact.com", style: "dictionary")
+ person2 = FullContact.person(email: 'bart@fullcontact.com', style: 'dictionary')
# You can pass in any arbitrary parameters the Person API supports
- person3 = FullContact.person(email: "bart@fullcontact.com", style: "dictionary", webhookUrl: "https://...")
+ person3 = FullContact.person(email: 'bart@fullcontact.com', style: 'dictionary', webhookUrl: 'https://...')
# Get information about a twitter handle
- person4 = FullContact.person(twitter: "brawest")
+ person4 = FullContact.person(twitter: "bartlorang")
# Get information about a facebook username
- person5 = FullContact.person(facebookUsername: "bart.lorang")
+ person5 = FullContact.person(facebookUsername: 'bart.lorang')
# Get information from a phone number
person6 = FullContact.person(phone:13037170414)
-
- # Get information about a company
- company1 = FullContact.company(domain: 'fullcontact.com')
# Get information about a twitter and ensure a 30s socket open timeout and a 15s socket read timeout
# Can throw a Faraday::Error::TimeoutError if timeouts are exceeded
- person7 = FullContact.person({:twitter => "brawest"}, {:request => {:timeout => 15, :open_timeout => 30}})
+ person7 = FullContact.person({:twitter => "bartlorang"}, {:request => {:timeout => 15, :open_timeout => 30}})
- # Get person's family_name
- puts person.contact_info.family_name
```
+
+Response formats can more closely mirror FullContact's APIs by disabling snake_case transformation:
+```ruby
+ FullContact.configure do |config|
+ config.api_key = "fullcontact_api_key_goes_here"
+ config.skip_rubyize = true
+ end
+
+ person8 = FullContact.person(email: "bart@fullcontact.com")
+
+ => #<Hashie::Mash contactInfo=#<Hashie::Mash chats=[#<Hashie::Mash client="gtalk" handle="lorangb@gmail.com">,
+ #<Hashie::Mash client="skype" handle="bart.lorang">] familyName="Lorang" fullName="Bart Lorang" givenName="Bart...
+```
+
+You can also query the Company API
+```ruby
+ # Get information about a company
+ company1 = FullContact.company(domain: 'fullcontact.com')
+
+ company1.organization.name
+ => "FullContact Inc."
+```
+
Contributions
-------------
-- Michael Rose (Xorlev)
-- Brandon West (bwest)
-- Ian Fisher (i-taptera)
-- Scott Watermasysk (scottwater)
-- Stefano Fontanelli (stefanofontanelli)
-- John Bachir (jjb)
+A full list of contributors can be found in
+[GitHub](https://github.com/fullcontact/fullcontact-api-ruby/graphs/contributors)
License
---------
-Copyright (c) 2014 FullContact Inc. and contributors
+Copyright (c) 2015 FullContact Inc. and contributors
See [LICENSE](https://github.com/fullcontact/fullcontact-api-ruby/blob/master/LICENSE.md) for details.