craftar 0.0.9.2 → 0.0.9.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b47563b6f2157dfc7adf06de97fdb0eda0a511bf
4
- data.tar.gz: 6d32c8f9dd93a051cc500c3f7d1079401b5bea07
3
+ metadata.gz: 7bb832b6d1d5e33d3bf8a6a0aad88131da73f865
4
+ data.tar.gz: b1963fb4271a98559cbd96908f2939b457b35e48
5
5
  SHA512:
6
- metadata.gz: 1802139e1286cbb0d34a0e6ab56d0cd60fb2c4c7086e25373809b72a037df641ea9bf7137b7288e4e65cf43d28cde88b0e824cdf231b5aca2da1aa2abaee86f2
7
- data.tar.gz: b45462ee952be74a6d32c91c37e370d2d69f2ab75f1884a1df1e1bd321d3e4cf302fb65fd9f55ad8edfdaab98a7faf0742040429a557a1de90ca5357019b11b1
6
+ metadata.gz: 7af00bde5f47e7349b4d830d9c89a125292c6205761f4f5451e7deab9b807655927adcc3646a8c357aa944f580ed252c4c21951844a152143cc16001c5bbcf18
7
+ data.tar.gz: 9e63d66f27cd45cf2862e2ce54aaa25836307078b63579748641f8c591f73030224fd0cad0c1d1dfdc23bce2c32f88aaf559a0b83431ed7127bb4883b16078fe
@@ -17,7 +17,7 @@ module Craftar
17
17
  :post,
18
18
  {
19
19
  name: @name,
20
- collection: @collection,
20
+ collection: @collection
21
21
  }
22
22
  )
23
23
  @uuid = response['uuid']
@@ -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 find(token)
22
- raise 'You cannot find a token'
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: craftar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9.2
4
+ version: 0.0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marieke Gueye