spartacus 0.0.1 → 0.0.2
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/lib/spartacus.rb +7 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ca55f3c2316317e117783084b4af097a65c4832
|
4
|
+
data.tar.gz: 35089056071b8942a60a0991f1dd1c2a1100e25f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a95f1fe5c88b0038123b3e1a975dd32081d6bfae29521efa02a54c8924ff58486aa8ae52ca93748bb99f0b3045571c17b2d577c708b3992d562b3c28f2d33c63
|
7
|
+
data.tar.gz: 021acff48304df8e2cf432e58da8243776433996969f13beecb5423b3090450c722409709d0a22ff4abc79002cc018f71fb25c00ab994a2eb35bfb0c257d70a6
|
data/lib/spartacus.rb
CHANGED
@@ -31,18 +31,19 @@ class Spartacus
|
|
31
31
|
# @option options [String] :body Checkpoint body.
|
32
32
|
# @option options [String] :assignment Checkpoint assignment.
|
33
33
|
# @option options [Integer] :points Checkpoint point.
|
34
|
+
# @option options [String] :body_and_assignment Checkpoint body and Assignment
|
34
35
|
# @return [HTTParty::Response] The updated checkpoint
|
35
36
|
# @example Update a checkpoint
|
36
37
|
# SpartacusClient.new.update_checkpoint(129, {name: 'Real Cool Checkpoint'})
|
37
38
|
def update_checkpoint(id, options={})
|
38
|
-
accepted_params = [:name, :summary, :body, :assignment, :points]
|
39
|
+
accepted_params = [:name, :summary, :body, :assignment, :points, :body_and_assignment]
|
39
40
|
checkpoint_params = options.select {|k, v| accepted_params.include?(k) }
|
40
41
|
update_checkpoint_url = "#{base_path}/checkpoints/#{id}"
|
41
42
|
|
42
43
|
handle_timeouts do
|
43
44
|
self.class.put(update_checkpoint_url,
|
44
45
|
headers: auth_header,
|
45
|
-
query: { checkpoint: checkpoint_params })
|
46
|
+
query: { checkpoint: checkpoint_params })
|
46
47
|
end
|
47
48
|
end
|
48
49
|
|
@@ -55,3 +56,7 @@ class Spartacus
|
|
55
56
|
{ "authorization" => @api_jwt }
|
56
57
|
end
|
57
58
|
end
|
59
|
+
|
60
|
+
sc = Spartacus.new("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcGlfa2V5IjoiNzdkNzE2MTQxMDNhNDRhMzg1NzVlMTdjM2M2MGVmMDYiLCJ1c2VyX2lkIjo1MzcxMDQsIm5hbWUiOiJCZW4gTmVlbHkifQ.GGPpHoYJR0q2pP8-Fmb-jgu4PjvQ9IZgt-He8uQg3dE")
|
61
|
+
|
62
|
+
sc.update_checkpoint(129, {body_and_assignment: "9999999 '## Assignment &&&777777777"})
|