view_component_reflex 2.3.4 → 2.3.5
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/README.md +332 -332
- data/app/components/view_component_reflex/component.rb +198 -198
- data/lib/view_component_reflex.rb +10 -10
- data/lib/view_component_reflex/engine.rb +36 -36
- data/lib/view_component_reflex/reflex.rb +147 -147
- data/lib/view_component_reflex/reflex_factory.rb +55 -55
- data/lib/view_component_reflex/state_adapter/memory.rb +25 -25
- data/lib/view_component_reflex/state_adapter/session.rb +24 -24
- data/lib/view_component_reflex/version.rb +3 -3
- metadata +2 -2
@@ -1,24 +1,24 @@
|
|
1
|
-
module ViewComponentReflex
|
2
|
-
module StateAdapter
|
3
|
-
class Session
|
4
|
-
def self.state(request, key)
|
5
|
-
request.session[key] ||= {}
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.set_state(request, controller, key, new_state)
|
9
|
-
new_state.each do |k, v|
|
10
|
-
state(request, key)[k] = v
|
11
|
-
end
|
12
|
-
store = request.session.instance_variable_get("@by")
|
13
|
-
store.commit_session request, controller.response
|
14
|
-
end
|
15
|
-
|
16
|
-
def self.store_state(request, key, new_state = {})
|
17
|
-
request.session[key] = {}
|
18
|
-
new_state.each do |k, v|
|
19
|
-
request.session[key][k] = v
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
1
|
+
module ViewComponentReflex
|
2
|
+
module StateAdapter
|
3
|
+
class Session
|
4
|
+
def self.state(request, key)
|
5
|
+
request.session[key] ||= {}
|
6
|
+
end
|
7
|
+
|
8
|
+
def self.set_state(request, controller, key, new_state)
|
9
|
+
new_state.each do |k, v|
|
10
|
+
state(request, key)[k] = v
|
11
|
+
end
|
12
|
+
store = request.session.instance_variable_get("@by")
|
13
|
+
store.commit_session request, controller.response
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.store_state(request, key, new_state = {})
|
17
|
+
request.session[key] = {}
|
18
|
+
new_state.each do |k, v|
|
19
|
+
request.session[key][k] = v
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module ViewComponentReflex
|
2
|
-
VERSION = '2.3.
|
3
|
-
end
|
1
|
+
module ViewComponentReflex
|
2
|
+
VERSION = '2.3.5'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: view_component_reflex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joshua LeBlanc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|