triplet 0.1.0 → 0.1.1
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/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/triplet/version.rb +1 -1
- data/lib/triplet/view_component.rb +3 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9a70da4253bc13f56358d94ad6fd728a5ff505d08eaa189cf7340f2738f6f56
|
4
|
+
data.tar.gz: 401e54a2a4232d02169a120e52a020ee8c040127ac3c6d5abccc35bba3bfe583
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 191d40c421c97a606a7aaa8266a5fbe031b9be87b27b3768717222e692080fdb2f57c13fd14b716cba9d6bc80566a3f46c5f2a27989ab18c817379f88523db19
|
7
|
+
data.tar.gz: c8968e91d41f1613bda73c0eb8edfdf3471e3a5b41fa78ab31204265ddc55ce6e541d710592ec5d263a712d1949a8961c38aec3225dcbe105a3be2df73587491
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -68,13 +68,13 @@ b { "world" }
|
|
68
68
|
### View Component Support
|
69
69
|
|
70
70
|
To use in view components, include the `Triplet::ViewComponent` module and
|
71
|
-
define a `
|
71
|
+
define a `call` method. The module will handle the rest.
|
72
72
|
|
73
73
|
```ruby
|
74
74
|
class NavComponent < ::ViewComponent::Base
|
75
75
|
include Triplet::ViewComponent
|
76
76
|
|
77
|
-
def
|
77
|
+
def call
|
78
78
|
h1 { "hello world" }
|
79
79
|
|
80
80
|
render NavItemComponent.new(title: "Home", path: "/")
|
data/lib/triplet/version.rb
CHANGED
@@ -6,15 +6,9 @@ module Triplet
|
|
6
6
|
module ViewComponent
|
7
7
|
include Triplet::DSL
|
8
8
|
|
9
|
-
def
|
10
|
-
|
11
|
-
|
12
|
-
template
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def template
|
17
|
-
raise "#template method not implemented"
|
9
|
+
def render_in(view_context, &block)
|
10
|
+
@output_buffer ||= ActionView::OutputBuffer.new
|
11
|
+
super(view_context, &block)
|
18
12
|
end
|
19
13
|
end
|
20
14
|
end
|