API client for pipelinedeals.com
Add it to your application's Gemfile:
gem 'pipeline_dealers'
The client's API is modelled after ActiveRecord.
require 'pipeline_dealers'
client = Pipelinedealers::Client.new(api_key: "z3kr3tp@zzw0rd")
# Get all companies
client.companies.all.each do |company|
puts company.name
end
# Find company by ID
my_company = client.companies.find(id)
my_company.name = "foobar"
my_company.save
For more details and how to use people and notes, see the examples
require 'pipeline_dealers'
require 'pipeline_dealers/test'
describe "MyClass" do
let(:client) { Pipelinedealers::TestClient.new }
it "should create a company" do
expect do
client.companies.create(name: "AwesomeCompany")
end.to change(client.companies, :length).from(0).to(1)
end
end
Note: Be sure to stub the client in your code. This only works if you use the same client reference in both the specs and your application. For more examples, see these examples and how to run them
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
The awesome people at