README.md in genderize-io-0.1.0 vs README.md in genderize-io-1.0.0
- old
+ new
@@ -1,11 +1,12 @@
# Genderize::Io
[![Gem Version](https://badge.fury.io/rb/genderize-io.svg)](http://badge.fury.io/rb/genderize-io)
[![Build Status](https://travis-ci.org/drexed/genderize-io.svg?branch=master)](https://travis-ci.org/drexed/genderize-io)
-API wrapper for the free [Genderize.io](https://genderize.io) gender determination system.
+API wrapper for the [Genderize.io](https://genderize.io) first name gender determination system.
+*Be aware that the free API has a limit of 1000 determinations per day.*
## Installation
Add this line to your application's Gemfile:
@@ -20,35 +21,66 @@
Or install it yourself as:
$ gem install genderize-io
## Usage
+
+### Lookup Determination
+
```ruby
# Basic Lookup
-lookup = Genderize::Io::Lookup.new('kim').verify
-lookup = Genderize::Io::Lookup.verify('kim')
+lookup = Genderize::Io::Lookup.new('kim').determine
+lookup = Genderize::Io::Lookup.determine('kim')
-# Custom Host
-lookup = Genderize::Io::Lookup.new('kim', host: 'https://api.genderize.io?api_key=xxx').verify
-lookup = Genderize::Io::Lookup.verify('kim', host: 'https://api.genderize.io?api_key=xxx')
+# Custom Options
+lookup = Genderize::Io::Lookup.determine('kim', host: 'https://api.genderize.io?api_key=xxx',
+ country_id: 'dk',
+ language_id: 'en')
+```
-# Custom IDs
-lookup = Genderize::Io::Lookup.new('kim', country_id: 'dk').verify
-lookup = Genderize::Io::Lookup.verify('kim', language_id: 'en')
+### Lookup Methods
-# Public Methods
+```ruby
lookup.url => 'https://api.genderize.io?name=kim'
-lookup.to_h => { 'name' => 'kim', 'gender' => 'female', ... }
+lookup.data => { 'name' => 'kim', 'gender' => 'female', ... }
+
+# Data Methods
lookup.name => 'kim'
lookup.gender => 'female'
lookup.probability => 0.94
lookup.count => 1098
lookup.country_id => 'dk'
lookup.language_id => 'en'
lookup.x_rate_limit_limit => 1000
lookup.x_rate_limit_remaining => 738
lookup.x_rate_reset => 13829
lookup.error => 'sorry, my bad!'
+```
+
+### Batch Lookup Determination
+
+```ruby
+# Basic Lookup
+lookup = Genderize::Io::Batch::Lookup.new(['kim', 'jim']).determine
+lookup = Genderize::Io::Batch::Lookup.determine(['kim', 'jim'])
+
+# Custom Options
+lookup = Genderize::Io::Batch::Lookup.determine(['kim', 'jim'], host: 'https://api.genderize.io?api_key=xxx',
+ country_id: 'dk',
+ language_id: 'en')
+```
+
+### Batch Lookup Methods
+
+```ruby
+lookup.url => 'https://api.genderize.io?name[0]=kim&name[1]=jim'
+lookup.data => {
+ 'rate_limits' => { 'x_rate_limit_limit' => 1069, ... },
+ 'responses' => [
+ { 'name' => 'kim', 'gender' => 'female', ... },
+ { 'name' => 'jim', 'gender' => 'male', ... }
+ ]
+ }
```
## Contributing
Your contribution is welcome.