clapton 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01e0976bdfdb23e447884dec93ee2f25ceb2d5e0312ca4a54aeed3ba603a69c2
4
- data.tar.gz: e950680f7a0928e186eb14ae04d1479e741e55670ec16ee97a6cc4b799edeb0e
3
+ metadata.gz: 046d950b41177907e9ab5aeeecddbed15ba622b5f4af1b68be7931ac5b50ee81
4
+ data.tar.gz: 673129d40cb46bbdd4b98083d79d256acfc04c6361ae275c71db2cbc0fc22f6d
5
5
  SHA512:
6
- metadata.gz: d3ed3bd257263eb9875acb301c798d18bed14700cbed7352b8ac55187e320f8a49a555a6fbbd90e3db6980c9b4572ed62371a7d3f16af7b60a858a1ab02102de
7
- data.tar.gz: d89a048e4c2df53e1fb35c01063c6f59e3eef7f3737907b8523c8c919ad2eb84fc7cce63f138455ecf6d29650df12a387d64e7e348fedfffdc47760cf6b14393
6
+ metadata.gz: 922bfbd2feae17c2ae3a040ce2eb573e7a9a1b951f93775c0f24b44bc90569177eb93e95bfb16f2fe515dcaec5d3526c92d976f29779d3a31d4024eeae4b42aa
7
+ data.tar.gz: 8157150ab886370b4dbff0cd38fcd064ba9e044422cb45a8d9940b67b77ed3e781679ee38c01604cb000ef59f3e0360c2e785c69d725925e809d2021a4a6aedb
data/README.md CHANGED
@@ -140,7 +140,12 @@ mount Clapton::Engine => "/clapton"
140
140
  ### Component rendering
141
141
 
142
142
  ```html
143
- <%= clapton_component_tag([:TaskListComponent, { tasks: @tasks.map { |task| { id: task.id, title: task.title, due: task.due, done: task.done } }]) %>
143
+ <%= clapton_component_tag(
144
+ :TaskListComponent,
145
+ {
146
+ tasks: @tasks.map { |task| { id: task.id, title: task.title, due: task.due, done: task.done } }
147
+ }
148
+ ) %>
144
149
  ```
145
150
 
146
151
  ### Generate Component and State
@@ -18,12 +18,12 @@ module Clapton
18
18
  tag.div(id: "clapton", data: { clapton: datas })
19
19
  end
20
20
 
21
- def clapton_component_tag(component)
22
- state_class = component[0].to_s.gsub("Component", "State")
21
+ def clapton_component_tag(component, params)
22
+ state_class = component.to_s.gsub("Component", "State")
23
23
  if Object.const_defined?(state_class)
24
- data = { component: component[0].to_s, state: Object.const_get(state_class).new(component[1]).to_h }
24
+ data = { component: component.to_s, state: Object.const_get(state_class).new(params).to_h }
25
25
  else
26
- data = { component: component[0].to_s, state: {} }
26
+ data = { component: component.to_s, state: {} }
27
27
  end
28
28
  tag.div(class: "clapton-component", data: { clapton: data })
29
29
  end
@@ -1,3 +1,4 @@
1
1
  module Clapton
2
- VERSION = '0.0.7'
2
+ VERSION = '0.0.8'
3
3
  end
4
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clapton
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Moeki Kawakami