flame 4.16.0 → 4.17.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 +4 -4
- data/lib/flame/controller.rb +18 -1
- data/lib/flame/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ccec989786ef96d130c6526ac47ef646defd74
|
4
|
+
data.tar.gz: 20f122fcea6d8eebeb420eb58e93d00f85243084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdcedf23fb41f2cab59be449f0daa40dc529e3b832bf11fe04fa4d1d01c0e008b199580bd107bc7dec5a2935554b5b9016d0277b7c63439b229c37e9bb02275e
|
7
|
+
data.tar.gz: 07e37694dd64ab3da6a0ca659fccc3c4832b620a4be57ef13a512b7694acc963e778aeaabb4cf20f7934b75ef92340d0a40b195caa31a9aa581fb91f4770b0e2
|
data/lib/flame/controller.rb
CHANGED
@@ -178,11 +178,28 @@ module Flame
|
|
178
178
|
## @example Inherit controller with parent actions by method
|
179
179
|
## class MyController < BaseController.with_actions
|
180
180
|
## end
|
181
|
-
|
181
|
+
## @example Define actions from module in controller
|
182
|
+
## class MyController < BaseController
|
183
|
+
## include with_actions Module1
|
184
|
+
## include with_actions Module2
|
185
|
+
## ....
|
186
|
+
## end
|
187
|
+
def with_actions(mod = nil)
|
188
|
+
return mod.extend(ModuleActions) if mod
|
182
189
|
@with_actions ||= Class.new(self) { extend ParentActions }
|
183
190
|
end
|
184
191
|
end
|
185
192
|
|
193
|
+
## Extension for modules whose public methods will be defined as actions
|
194
|
+
## via including
|
195
|
+
module ModuleActions
|
196
|
+
def included(ctrl)
|
197
|
+
public_instance_methods.each do |meth|
|
198
|
+
ctrl.send :define_method, meth, public_instance_method(meth)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
186
203
|
## Module for public instance methods re-defining from superclass
|
187
204
|
## @example Inherit controller with parent actions by `extend`
|
188
205
|
## class MyController < BaseController
|
data/lib/flame/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flame
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Popov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06-
|
11
|
+
date: 2017-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|