Module: Rails
- Defined in:
- lib/model_manage/rails.rb
Constant Summary collapse
- @@app =
{ child: { models: [], controllers: [], helpers: [], }, inherit: { models: [], controllers: [], helpers: [], }, }
Class Method Summary collapse
- .add_child(type, base) ⇒ Object
- .add_inherit(type, base) ⇒ Object
- .child_controllers ⇒ Object
- .child_helpers ⇒ Object
- .child_models ⇒ Object
- .controllers ⇒ Object
- .helpers ⇒ Object
- .models ⇒ Object
Class Method Details
.add_child(type, base) ⇒ Object
34 35 36 37 38 39 |
# File 'lib/model_manage/rails.rb', line 34 def self.add_child(type, base) (@@app[:child][type] ||= []).tap do |o| o.push base o.uniq! end end |
.add_inherit(type, base) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/model_manage/rails.rb', line 41 def self.add_inherit(type, base) (@@app[:inherit][type] ||= []).tap do |o| o.push base o.uniq! end @@app[:child][type] -= @@app[:inherit][type] end |
.child_controllers ⇒ Object
27 28 29 |
# File 'lib/model_manage/rails.rb', line 27 def self.child_controllers @@app[:child][:controllers] end |
.child_helpers ⇒ Object
30 31 32 |
# File 'lib/model_manage/rails.rb', line 30 def self.child_helpers @@app[:child][:helpers] end |
.child_models ⇒ Object
24 25 26 |
# File 'lib/model_manage/rails.rb', line 24 def self.child_models @@app[:child][:models] end |
.controllers ⇒ Object
17 18 19 |
# File 'lib/model_manage/rails.rb', line 17 def self.controllers @@app[:child][:controllers] | @@app[:inherit][:controllers] end |
.helpers ⇒ Object
20 21 22 |
# File 'lib/model_manage/rails.rb', line 20 def self.helpers @@app[:child][:helpers] | @@app[:inherit][:helpers] end |
.models ⇒ Object
14 15 16 |
# File 'lib/model_manage/rails.rb', line 14 def self.models @@app[:child][:models] | @@app[:inherit][:models] end |