<commit_before># The Infusionsoft Ruby Gem
A Ruby wrapper for the Infusionsoft API

**This is a complete rewrite and has been implemented as a RubyGem**
All previous versions will need to update their calls to follow the new schema

## <a name="installation">Installation</a>
    gem install infusionsoft

## <a name="documentation">Documentation</a>
[http://rubydoc.info/gems/infusionsoft/1.0.2/frames](http://rubydoc.info/gems/infusionsoft/1.0.2/frames)

## <a name="setup">Setup & Configuration</a>
Rails 2.3 - add `config.gem 'infusionsoft'` 
Rails 3 - add `'infusionsoft'` to your `Gemfile`

Then create an initializer in `config\initializers` called infusionsoft.rb and the following

    Infusionsoft.configure do |config|
      config.api_url = 'YOUR_INFUSIONSOFT_URL' # example infused.infusionsoft.com
      config.api_key = 'YOUR_INFUSIONSOFT_API_KEY'
    end

## <a name="examples">Usage Examples</a>

    # Get a users first and last name using the DataService
    Infusionsoft.data_load('Contact', contact_id, [:FirstName, :LastName])

    # Update a contact with specific field values 
    Infusionsoft.contact_upudate(contact_id, { :FirstName => 'first_name', :Email => '<EMAIL>' })

    # Add a new Contact
    Infusionsoft.contact_add({:FirstName => 'first_name', :LastName => 'last_name', :Email => '<EMAIL>'})

    # Create a blank Invoice
    invoice_id = Infusionsoft.invoice_create_blank_order(contact_id, description, Date.today, lead_affiliate_id, sale_affiliate_id)

    # Then add item to invoice<commit_msg>updated link to documentation and updated setup config<commit_after># The Infusionsoft Ruby Gem
A Ruby wrapper for the Infusionsoft API

**This is a complete rewrite and has been implemented as a RubyGem**
All previous versions will need to update their calls to follow the new schema

## <a name="installation">Installation</a>
    gem install infusionsoft

## <a name="documentation">Documentation</a>
[http://rubydoc.info/gems/infusionsoft/frames](http://rubydoc.info/gems/infusionsoft/frames)

## <a name="setup">Setup & Configuration</a>
1. **Rails 2.3** - add `config.gem 'infusionsoft'` **Rails 3** - add `'infusionsoft'` to your `Gemfile`
2. Then create an initializer in `config\initializers` called infusionsoft.rb and the following

    Infusionsoft.configure do |config|
      config.api_url = 'YOUR_INFUSIONSOFT_URL' # example infused.infusionsoft.com
      config.api_key = 'YOUR_INFUSIONSOFT_API_KEY'
    end

## <a name="examples">Usage Examples</a>

    # Get a users first and last name using the DataService
    Infusionsoft.data_load('Contact', contact_id, [:FirstName, :LastName])

    # Update a contact with specific field values
    Infusionsoft.contact_upudate(contact_id, { :FirstName => 'first_name', :Email => '<EMAIL>' })

    # Add a new Contact
    Infusionsoft.contact_add({:FirstName => 'first_name', :LastName => 'last_name', :Email => '<EMAIL>'})

    # Create a blank Invoice
    invoice_id = Infusionsoft.invoice_create_blank_order(contact_id, description, Date.today, lead_affiliate_id, sale_affiliate_id)

    # Then add item to invoice
{'fraction_non_alphanumeric': 0.11318327974276528, 'fraction_numerical': 0.0045016077170418, 'mean_word_length': 4.7292817679558015, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6042380', 'n_tokens_mistral': 1010, 'n_tokens_neox': 958, 'n_words': 280}