accredible-ruby 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +60 -0
- data/lib/accredible-ruby/credential.rb +1 -1
- data/lib/accredible-ruby/version.rb +1 -1
- data/spec/support/credential_helper.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07764fbf9847f0a6b47dc7a09903ca6b30dc8521
|
4
|
+
data.tar.gz: df088ea0c1bd238f43cba2cba57c9a4451bb27e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 028a92f60543dc78fa84be4fc6023bea90492554e622239825b8040cff6b6af884f6e4ea8c0909958061b609ff86c17749373c2ba77387125a554ec0b76abf19
|
7
|
+
data.tar.gz: a462a3fc43828da82b72f6e3226fae20a9b34c856c6bdb5323a183854b34878f47f4bad68f2c65bd1af49b7daca7d648edef2fecc49474cd201931cba8614726
|
data/README.md
CHANGED
@@ -1 +1,61 @@
|
|
1
1
|
# accredible
|
2
|
+
Install
|
3
|
+
--------
|
4
|
+
Add the following line to Gemfile:
|
5
|
+
|
6
|
+
```ruby
|
7
|
+
gem 'accredible-ruby'
|
8
|
+
```
|
9
|
+
and run `bundle install` from your shell.
|
10
|
+
Then add the following line to an initializer, or appropriate config file.
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
Accredible.api_key = ENV['ACCREDIBLE_API_KEY']
|
14
|
+
```
|
15
|
+
|
16
|
+
Basic Usage
|
17
|
+
-----------
|
18
|
+
```ruby
|
19
|
+
# creating a certificate
|
20
|
+
recipient = {name: "Jared Smith", email: "example@example.com"}
|
21
|
+
credential = {name: "#{course.title}",
|
22
|
+
cohort_name: "Example Cohort",
|
23
|
+
description: "A certificate of completion for a cool course",
|
24
|
+
issued_on: "2016-03-15",
|
25
|
+
course_link: "http://onemonth.com/courses/one-month-rails"}
|
26
|
+
|
27
|
+
# evidence and references are both optional but can be constructed like this
|
28
|
+
evidence =
|
29
|
+
[{description: "Evidence of completion",
|
30
|
+
url: "http://example.com/evidence",
|
31
|
+
category: "url"},
|
32
|
+
{description: "Evidence of completion 2",
|
33
|
+
file: "https://s3.amazonaws.com/accredible_api_evidence_items/files/12/original/open-uri20140316-15266-1m3by6h.jpeg",
|
34
|
+
category: "file"}]
|
35
|
+
references= [{description: "John worked hard",
|
36
|
+
relationship: "managed",
|
37
|
+
referee: {name: "Jane Doe",
|
38
|
+
email: "jane@example.com",
|
39
|
+
avatar: "https://placehold.it/100x100"}}
|
40
|
+
]
|
41
|
+
|
42
|
+
Accredible::Credential.create(
|
43
|
+
recipient: recipient,
|
44
|
+
credential: credential,
|
45
|
+
evidence: evidence,
|
46
|
+
references: references)
|
47
|
+
```
|
48
|
+
|
49
|
+
Supported Ruby versions
|
50
|
+
-----------------------
|
51
|
+
Currently only Ruby 2.0+ is supported. Contributions are welcome if you need to
|
52
|
+
support a different version.
|
53
|
+
|
54
|
+
License
|
55
|
+
-------
|
56
|
+
Accredible-Ruby is is free software, and may be redistributed under the
|
57
|
+
terms specified in the [LICENSE](/LICENSE) file.
|
58
|
+
|
59
|
+
Thanks to
|
60
|
+
---------
|
61
|
+
[One Month](http://onemonth.com) - For allowing this gem to be extracted and open sourced.
|
@@ -6,7 +6,7 @@ module Accredible
|
|
6
6
|
Accredible.request(uri)
|
7
7
|
end
|
8
8
|
|
9
|
-
def self.create(recipient:, credential:, evidence:
|
9
|
+
def self.create(recipient:, credential:, evidence: [], references: [])
|
10
10
|
params = Util.build_create_credential_params(recipient, credential, evidence, references)
|
11
11
|
uri = Credential.api_end_point
|
12
12
|
Accredible.request(uri, :post, params)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: accredible-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jared Smith
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.5.1
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Accredible API gem
|