flame 4.4.6 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/flame/controller.rb +24 -2
- 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: bee4c8c30a16739dcb07c56380cb708417391be2
|
4
|
+
data.tar.gz: c4eee8b0d6a07ef8fd989302053fa5d400c96bdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 898a1ee83de94d30416f8a838dc1f843684d54888c04cd9f660791ef0a60b65deb75e4b395a53af04d150b372042da5324e1ad9527485d79fade1a73f4ba8e34
|
7
|
+
data.tar.gz: c8f39a96bdd1b31d170e56e5a9e21e8c328ff4a78551b719a5f9fc982ec7b6435e24547fd60a4b5a2e89524fbdd1092c41062bdc42e7ad815a4769a30fda18c9
|
data/lib/flame/controller.rb
CHANGED
@@ -109,8 +109,30 @@ module Flame
|
|
109
109
|
parts.join('_')
|
110
110
|
end
|
111
111
|
|
112
|
-
##
|
113
|
-
|
112
|
+
## Re-define public instance method from parent
|
113
|
+
## @example Inherit controller with parent actions by method
|
114
|
+
## class MyController < BaseController.with_actions
|
115
|
+
## end
|
116
|
+
def with_actions
|
117
|
+
@with_actions ||= Class.new(self) { extend ParentActions }
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
## Module for public instance methods re-defining from superclass
|
122
|
+
## @example Inherit controller with parent actions by `extend`
|
123
|
+
## class MyController < BaseController
|
124
|
+
## extend Flame::Controller::ParentActions
|
125
|
+
## end
|
126
|
+
module ParentActions
|
127
|
+
def inherited(ctrl)
|
128
|
+
ctrl.define_parent_actions
|
129
|
+
end
|
130
|
+
|
131
|
+
def self.extended(ctrl)
|
132
|
+
ctrl.define_parent_actions
|
133
|
+
end
|
134
|
+
|
135
|
+
def define_parent_actions
|
114
136
|
superclass.public_instance_methods(false).each do |public_method|
|
115
137
|
um = superclass.public_instance_method(public_method)
|
116
138
|
define_method public_method, um
|
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.5.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: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|