strawberry_api 0.5.1 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0be4e293d77819ac19c19e8888f46325ed886dd60d31c5e03f3bc6adeb9f244
4
- data.tar.gz: 309a7bc39eca2a339f6dbf42a3bb10236bc96886f06a1e8bedf47a8aca2a97ee
3
+ metadata.gz: 8bd3e8a7180a84d5922b82818630c1d6caf411192a53931a760f69e1d6b4be53
4
+ data.tar.gz: 8bb1bb8332663b4e5efa66c89a9820b42f180bcd7d7f987b8b7e0d356d274430
5
5
  SHA512:
6
- metadata.gz: a3dee150201813d409a46292252a82f48937a7dfd95ccefcdb5f3369825f797350aae035e42a18780787a381670767b3eceda116cf8e7fca41bd4232bd9a70ae
7
- data.tar.gz: 80346c05e4896bdd2c4217afcc91983feefc5ffae843c98520e8f37f9efb4e7ff13081a8abfb123a16a9225fbfaf210633d332d234691ddf4e952e6ee354c924
6
+ metadata.gz: 69044cfcefedcc0a93d76a32163f5db2f37e3cdaebf69aca9067037147fac68ad09b96c4a9ea8a614876432706a5ccd13ba7b59cc227132aadd361601c98058f
7
+ data.tar.gz: 16cbdddfc184c937e9a3844c58f71be2c5c4aa1cdb14a3c8de189881abc4361fd83d9724ae0033b1ddc1f0be814d4f94e4e6bc483fac229152958bba642bcae4
@@ -13,6 +13,29 @@ module StrawberryAPI
13
13
  end
14
14
  end
15
15
 
16
+ # Fetches a ustom metadata field
17
+ #
18
+ # @param [Integer] id Id of the ustom metadata field to retrieve
19
+ #
20
+ # @return [StrawberryAPI::Feature] The fetched ustom metadata field
21
+ #
22
+ def custom_metadata_field(id:)
23
+ data = get("/custom_metadata_fields/#{id}").parse['custommetadatafield']
24
+ data.nil? ? nil : CustomMetadataField.new(data)
25
+ end
26
+
27
+ # Updates a custom metadata field
28
+ #
29
+ # @param [Interger] id Id of the custom metadata field to update
30
+ # @param [Hash] options Hash of options
31
+ #
32
+ # @return [StrawberryAPI::CustomMetadataField] The updated custom metadata field
33
+ #
34
+ def update_custom_metadata_field(id:, options: {})
35
+ data = put("/custom_metadata_fields/#{id}", body: options.to_json).parse['custommetadatafield']
36
+ data.nil? ? nil : CustomMetadataField.new(data)
37
+ end
38
+
16
39
  end
17
40
  end
18
41
  end
@@ -1,3 +1,3 @@
1
1
  module StrawberryAPI
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
data/samples/test.rb CHANGED
@@ -8,4 +8,6 @@ StrawberryAPI.configure do |c|
8
8
  end
9
9
 
10
10
  strawberry = StrawberryAPI::Client.new
11
- project = strawberry.create_project(name: 'poupi', templatename: 'Library')
11
+
12
+ #strawberry.update_custom_metadata_field(id: 75, options: {mandatory: false})
13
+ p strawberry.custom_metadata_field(id: 75)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strawberry_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Lebrun
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-10-31 00:00:00.000000000 Z
11
+ date: 2019-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler