widgets_api_client 0.1.0.6 → 0.1.0.7
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/domain/widget.rb +9 -9
- data/lib/services/widget_service.rb +2 -1
- data/lib/widgets_api_client.rb +1 -1
- 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: 9aa0603c54423c0b6713dd84a60553b5642e3324
|
4
|
+
data.tar.gz: 51f050f4f67eb72bc8cf2343ab6bc071aa968d2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 543f358afe679f10884a29a5683e01cc4d609c6852d96802a8175c07edb846fbffd335903962b9e43de6b09e057fed79d8af47564886e5b560ad8d1fa0e88c1a
|
7
|
+
data.tar.gz: cfbafdb4720a1d425a56a470f5df70d432014f3d108f85fd7a1d9b40dfcceee8fca8792ae5520241fd4c129f8bd3ba4510cd530d8f69a592302a51140aa8f3c9
|
data/lib/domain/widget.rb
CHANGED
@@ -6,7 +6,7 @@ require 'json'
|
|
6
6
|
class Widget
|
7
7
|
attr_accessor :name
|
8
8
|
attr_accessor :description
|
9
|
-
attr_accessor :kind
|
9
|
+
#attr_accessor :kind
|
10
10
|
|
11
11
|
#
|
12
12
|
# Inialise the widget model
|
@@ -15,10 +15,10 @@ class Widget
|
|
15
15
|
# @param [String] description
|
16
16
|
# @param [String] kind Kind of widget - hidden/visible
|
17
17
|
#
|
18
|
-
def initialize(name: nil, description: nil
|
18
|
+
def initialize(name: nil, description: nil) #, kind: nil)
|
19
19
|
self.name = name
|
20
20
|
self.description = description
|
21
|
-
self.kind = kind
|
21
|
+
#self.kind = kind
|
22
22
|
end
|
23
23
|
|
24
24
|
#
|
@@ -29,13 +29,13 @@ class Widget
|
|
29
29
|
# @return [<Type>] Json represenatation of widget object
|
30
30
|
#
|
31
31
|
def to_json(*data)
|
32
|
-
|
32
|
+
{
|
33
33
|
name: @name,
|
34
|
-
description: @description
|
35
|
-
|
36
|
-
}
|
37
|
-
|
38
|
-
|
34
|
+
description: @description
|
35
|
+
# kind: @kind
|
36
|
+
}.to_json(*data)
|
37
|
+
# hash.delete_if { |k, v| v.nil? || v.empty? }
|
38
|
+
# hash.to_json(*data)
|
39
39
|
end
|
40
40
|
|
41
41
|
#
|
@@ -35,7 +35,8 @@ class WidgetService
|
|
35
35
|
# @return [Json] Response of update widget
|
36
36
|
#
|
37
37
|
def self.update_widget(widget, widget_id, bearer_token)
|
38
|
-
|
38
|
+
# puts widget.kind
|
39
|
+
#widget.attributes.except("name")
|
39
40
|
widget_data = get_widget(widget)
|
40
41
|
update_widget_payload = Widget.get_payload(widget_data)
|
41
42
|
puts update_widget_payload
|
data/lib/widgets_api_client.rb
CHANGED
@@ -280,5 +280,5 @@ end
|
|
280
280
|
#widget = Widget.new
|
281
281
|
#widget.name ='updated'
|
282
282
|
#widget.description ='new update'
|
283
|
-
#WidgetsApiClient.update_widget(widget, 206,'Bearer
|
283
|
+
#WidgetsApiClient.update_widget(widget, 206,'Bearer 6825d9b46bf447563c062504814eb0e0fcda105dbdea55e32680d6f054f252e8')
|
284
284
|
|