Cropster ruby gem. Make API calls to cropster to pull green and roasted coffee data.
Add this line to your application's Gemfile:
gem 'cropster'
And then execute:
$ bundle
Or install it yourself as:
$ gem install cropster
Setup Initializer
client = Cropster::Client.new({
api_key: ENV['CROPSTER_API_KEY'],
api_secret: ENV['CROPSTER_API_SECRET'],
group_code: ENV['CROPSTER_GROUP_CODE']
})
Optional keys for the client initialization include:
test_mode: (true | false)
api_path: "api/v2"
Cropster::Certificate.new(client).certificates({})
Cropster::Certificate.new(client).certificate("ID")
Cropster::Certificate.new(client).create_certificat(certificate_data)
Cropster::Certificate.new(client).
update_certificate("ID", certificate_data)
Cropster::Contact.new(client).contacts({})
Cropster::Contact.new(client).contact("ID")
Cropster::Group.new(client).groups({})
Cropster::Group.new(client).group("CROR")
Cropster::Location.new(client).locations({})
Cropster::Location.new(client).location("ID")
Cropster::Lot.new(client).lot("ID")
Cropster::Lot.new(client).lots
Cropster::Lot.new(client).create_lot(lot_data)
Cropster::Lot.new(client).update_lot("ID", lot_data)
Cropster::Machine.new(client).machine("ID")
Cropster::Machine.new(client).machines
Cropster::Processing.new(client).processings({})
Cropster::Processing.new(client).processing("ID")
Cropster::Project.new(client).projects({})
Cropster::Project.new(client).project("ID")
Cropster::SourceContact.new(client).source_contact("ID")
Cropster::Variety.new(client).varieties({})
Cropster::Variety.new(client).variety("ID")
- Fork it ( https://github.com/[my-github-username]/cropster/fork )
- 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 a new Pull Request