craftar 0.0.9.2 → 0.0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/craftar/tag.rb +1 -1
- data/lib/craftar/token.rb +12 -5
- 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: 7bb832b6d1d5e33d3bf8a6a0aad88131da73f865
|
4
|
+
data.tar.gz: b1963fb4271a98559cbd96908f2939b457b35e48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7af00bde5f47e7349b4d830d9c89a125292c6205761f4f5451e7deab9b807655927adcc3646a8c357aa944f580ed252c4c21951844a152143cc16001c5bbcf18
|
7
|
+
data.tar.gz: 9e63d66f27cd45cf2862e2ce54aaa25836307078b63579748641f8c591f73030224fd0cad0c1d1dfdc23bce2c32f88aaf559a0b83431ed7127bb4883b16078fe
|
data/lib/craftar/tag.rb
CHANGED
data/lib/craftar/token.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Craftar
|
2
2
|
class Token < Craftar::Base
|
3
|
-
attr_reader :token, :resource_uri, :collection
|
3
|
+
attr_reader :token, :resource_uri, :collection, :tags
|
4
4
|
def self.craftar_name
|
5
5
|
'token'
|
6
6
|
end
|
@@ -9,19 +9,26 @@ module Craftar
|
|
9
9
|
@collection = opts[:collection]
|
10
10
|
@token = opts[:token]
|
11
11
|
@resource_uri = opts[:resource_uri]
|
12
|
+
@tags = opts[:tags]
|
12
13
|
end
|
13
14
|
|
14
15
|
def save
|
15
|
-
response = json_call(:post, collection: @collection)
|
16
|
+
response = json_call(:post, collection: @collection, tags: @tags)
|
16
17
|
@token = response['token']
|
17
18
|
@resource_uri = response['resource_uri']
|
18
19
|
self
|
19
20
|
end
|
20
21
|
|
21
|
-
def
|
22
|
-
|
22
|
+
def update(opts)
|
23
|
+
options = {
|
24
|
+
tags: opts[:tags]
|
25
|
+
}.select { |_, value| !value.nil? }
|
26
|
+
response = json_call(:put, { uuid: @token }.merge(options))
|
27
|
+
@collection = response['collection']
|
28
|
+
@tags = response['tags']
|
29
|
+
@resource_uri = response['resource_uri']
|
30
|
+
self
|
23
31
|
end
|
24
|
-
|
25
32
|
def destroy
|
26
33
|
self.class.delete("/token/#{@token}/", self.class.basic_options)
|
27
34
|
end
|