Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
  lib
  spec
  .gitignore
  Gemfile
  Gemfile.lock
  LICENSE.txt
  README.md
  Rakefile
  market_sharp.gemspec
Size: Mime:
  README.md

MarketSharp

A Ruby wrapper for the MarketSharp REST API.

Installation

Add this line to your application's Gemfile:

gem 'market_sharp'

And then execute:

$ bundle

Or install it yourself as:

$ gem install market_sharp

Usage

Configuration

Before you can make calls to MarketSharp you must configure the library with a valid API Token. You can request a token be generated by MarketSharp. The API Token ties the API request to a particualr MarketSharp company id.

There are two ways to configure the gem. You can pass a hash of configuration options when you create a client, or you can use a configure block.


client = MarketSharp.client(company_id: 'YOUR_ACCOUNT_ID_HERE', user_key: 'YOUR_TOKEN_HERE', secret_key: 'YOUR_SECRET_HERE')

Example request:

params[:start_date]      = 'SOME_DATE_IN_THE_PAST'
(for sandbox account used to test the lastUpdated is in 2011
params[:end_date]        = Date.today
params[:sort_by]         = 'lastUpdate'
params[:sort_direction]  = 'asc'

customers = client.customers(params)

transactions = client.transactions(params)

customer = client.customer(id)

contracts = client.contracts_by_job_id(job_id)

MarketSharp.configure do |config|
  config.api_token = "YOUR_TOKEN_HERE"
end

client = MarketSharp.client

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request