Accredible Ruby gem.
Add this line to your application's Gemfile:
gem 'accredible'
And then execute:
$ bundle
Or install it yourself as:
$ gem install accredible
This is Gem for generating Accredible Certificate: https://www.accredible.com/example and adding evidence also to the project.
You will need a Accredible API key. You can get one by signing up here.
#Ruby Script
require 'accredible'
Accredible.api_key = 'YOUR_API_KEY'
#Rails, Add api key to config/application.rb
Accredible.api_key = 'YOUR_API_KEY'
1.) # Add a url based evidence to the user certificate
params = {email: "user_email", achievement_id: "course_achievement_id", url: "url of evidence", description: "description of evidence"}
#find course achievement_id from your Accredible dashboard.
#url can be anything which is available on cloud including files stored on #s3.
example params= {email: "deepender281190@gmail.com", achievement_id: "examplecourse1", url: "www.accredible.com", description: "example description"}
Accredible::Evidence.add_url_evidence(params)
2.) # Add a local file as evidence
params = {email: "user_email", achievement_id: "course_achievement_id", file: "location_of_file", description: "description of evidence"}
#location of file for ex: /user/var/example_pdf.pdf
example: params= {email: "deepender281190@gmail.com", achievement_id: "examplecourse1", file: "localfile.pdf", description: "example description"}
Accredible::Evidence.add_local_file(params)
-
Failed requests (such as the ones requesting non-existent entities) will throw
Accredible::AccredibleError
. -
We recommened to run actions as background jobs, so that user don't have to wait.
- Fork it ( https://github.com/[my-github-username]/accredible/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