kamiflex 0.13.0 → 0.14.0

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: 52be862e9467732b9b74fed2b580fb416a2c406e18c8a95630910d15b9695a05
4
- data.tar.gz: 8643628033a35ba62060bc5e2483cf62082776b4fd5460d53c5aa953bee11f6d
3
+ metadata.gz: 6f3a0c28faa7246ac46c30d299399e4a052238fd65ffbcf3876f3d212b5f8c7a
4
+ data.tar.gz: 23cff523a92f3eaa2519a295a4c29f31c2306a45016e3fa7e6cd9b5017637ffe
5
5
  SHA512:
6
- metadata.gz: c1b67b01143a046c2b89c428f259ca4bae19ac29318d2d011c397eef710e7efc0ef3f458ff2fa7a9db7aa53b24c3936cbc425db200c54ad98cdfb6a8c6662854
7
- data.tar.gz: 61a139760d665f13cd1ee925055383957a939883ca911efc1573977f674c918d2172030a8f0e538b00183e9679eb576c04d40fc5179dbfec978187f1c710da24
6
+ metadata.gz: fb297062b3e7037e25079f35597a616021a51d13244d6d157a1f71d2d04d38ec6af4cff3e6ed9c8ae3dba608c6fc360bd9878b7f62e0162f3678f292724ccd5c
7
+ data.tar.gz: 73de7d71fad0c304d603e8f1899f699abcf050e6f82ec9e0e72ab1d877bb0690eac743898c54c34a58fc79988fa88b1940ca47651da1f444f703d615fed80202
@@ -9,14 +9,19 @@ module Kamiflex
9
9
  end
10
10
 
11
11
  def uri_action(uri, **params)
12
- {
12
+ action = {
13
13
  type: "uri",
14
14
  label: uri[0...40],
15
- uri: uri,
16
- # altUri: {
17
- # desktop: uri
18
- # }
15
+ uri: uri
19
16
  }
17
+
18
+ if params[:desktop].present?
19
+ action[:altUri] = {
20
+ desktop: params[:desktop]
21
+ }
22
+ end
23
+
24
+ action
20
25
  end
21
26
 
22
27
  def postback_action(data, **params)
@@ -43,13 +43,22 @@ module Kamiflex
43
43
  end
44
44
 
45
45
  def url_button(label, url, **params)
46
- @flex_contents << {
47
- "type": "button",
48
- "action": {
49
- "type": "uri",
50
- "label": label,
51
- "uri": url
46
+ action = {
47
+ type: "uri",
48
+ label: label,
49
+ uri: url,
50
+ }
51
+
52
+ if params[:desktop].present?
53
+ action[:altUri] = {
54
+ desktop: params[:desktop]
52
55
  }
56
+ params = params.reject {|key, value| key == :desktop }
57
+ end
58
+
59
+ @flex_contents << {
60
+ type: "button",
61
+ action: action
53
62
  }.merge(params)
54
63
  end
55
64
 
@@ -1,3 +1,3 @@
1
1
  module Kamiflex
2
- VERSION = '0.13.0'
2
+ VERSION = '0.14.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamiflex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - etrex kuo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-24 00:00:00.000000000 Z
11
+ date: 2021-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json