kamiflex 0.6.0 → 0.7.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: 25d78af946f718c4852a4f219998607b74ca0ec359aa81f6337cf18ccd6ac870
4
- data.tar.gz: 77791a961cfc233ec98143247b22db938f147ad518e59beb13b0d0b59a95f7a3
3
+ metadata.gz: 5e7fe613294e762518f6e238a008e743a92d963e2ff5c2c94303a57a0fa7b397
4
+ data.tar.gz: e26144f0e5b2afce3deb2d72390cad843d3cd405e42fbed33d99aca58b71b4fb
5
5
  SHA512:
6
- metadata.gz: 84b89e7e4053cb6d14368fd29fdef583e05fe4e1d2a48542794188ee1e2c7c81032a9cd90f7f1e1da4013dabb54d77942ea76a7983aaa52af1d83f79a0cee2e4
7
- data.tar.gz: 61c2c81a1c7bbb837233082473df4a388d16ca5a0a122385a34bfd85a33508618c08bf2440b4c0fe4ea6d225b961ac8cfebb213e61f0f44e40acaa1db741eb64
6
+ metadata.gz: 3959e66bbc7ed8c128f380c451ff9783ab2a56b4b8bf71065ee0dde73f924e7dd60836ec63c85e1ddf59ab1b1920e780cc9c2ff644c7b62f9912b2f210c06b60
7
+ data.tar.gz: 293534b2bccf13af06a856e395790ba4697f4296012e63c8d35604372eff1d5d8705694cc9b035c4ae4020ac7ffcb3824db12d9e0c8594ffd00c3ef27f18eb2a
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # Kamiflex
2
- provide a pretty DSL to build your flex message like this:
2
+ Kamiflex provide a pretty DSL to build your [flex message of line messaging api](https://developers.line.biz/en/docs/messaging-api/using-flex-messages/) like this:
3
3
 
4
- #### in ruby
4
+ #### in pure ruby
5
5
  ``` ruby
6
- # flex_sample.rb
6
+ # example/todos_index.rb
7
7
  require 'kamiflex'
8
8
 
9
9
  @todos = [
@@ -21,7 +21,7 @@ require 'kamiflex'
21
21
  }
22
22
  ]
23
23
 
24
- puts Kamiflex.build(self) do
24
+ json = Kamiflex.build(self) do
25
25
  bubble do
26
26
  body do
27
27
  horizontal_box do
@@ -43,8 +43,14 @@ puts Kamiflex.build(self) do
43
43
  end
44
44
  end
45
45
  end
46
+
47
+ puts json
46
48
  ```
47
49
 
50
+ The render result looks like this:
51
+
52
+ ![](image/todos_index.png)
53
+
48
54
  #### in rails
49
55
  ``` ruby
50
56
  # todos/index.line.erb
@@ -72,12 +78,9 @@ end
72
78
  end )%>
73
79
  ```
74
80
 
75
- the render result looks like this:
76
-
81
+ I will make a template name `flex` for rails in the future.
77
82
 
78
-
79
-
80
- I will add a template name `flex` for rails in the future.
83
+ With this template, it's more clear then `erb`.
81
84
 
82
85
  ``` ruby
83
86
  # todos/index.line.flex
@@ -110,5 +113,8 @@ Add this line to your application's Gemfile:
110
113
  gem 'kamiflex'
111
114
  ```
112
115
 
116
+ ## Author
117
+ Create by [etrex](https://etrex.tw)
118
+
113
119
  ## License
114
120
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -36,6 +36,12 @@ module Kamiflex
36
36
  }.merge(params)
37
37
  end
38
38
 
39
+ def filler
40
+ @flex_contents << {
41
+ "type": "filler"
42
+ }
43
+ end
44
+
39
45
  def url_button(label, url, **params)
40
46
  @flex_contents << {
41
47
  "type": "button",
@@ -1,3 +1,3 @@
1
1
  module Kamiflex
2
- VERSION = '0.6.0'
2
+ VERSION = '0.7.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.6.0
4
+ version: 0.7.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: 2019-03-20 00:00:00.000000000 Z
11
+ date: 2019-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json