Module: Effective::Resources::Generator
- Included in:
- Effective::Resource
- Defined in:
- app/models/effective/resources/generator.rb
Instance Method Summary collapse
- #module_name ⇒ Object
-
#module_namespace ⇒ Object
Acpa.
-
#module_namespaced ⇒ Object
Admin::Courses.
-
#namespaced_class_name ⇒ Object
‘Admin::Effective::Post’.
-
#namespaced_module_name ⇒ Object
‘Admin::EffectivePosts’.
- #tenant_class_name ⇒ Object
-
#tenant_controller_path ⇒ Object
Tenants.
- #tenant_namespaced_class_name ⇒ Object
- #tenant_namespaced_module_name ⇒ Object
Instance Method Details
#module_name ⇒ Object
7 8 9 10 11 |
# File 'app/models/effective/resources/generator.rb', line 7 def module_name return nil unless class_name.split('::').length > 1 class_name.split('::').first end |
#module_namespace ⇒ Object
Acpa
14 15 16 17 18 |
# File 'app/models/effective/resources/generator.rb', line 14 def module_namespace return nil unless namespaces.present? Array(namespaces + [nil]).map { |name| name.to_s.classify } * '::' end |
#module_namespaced ⇒ Object
Admin::Courses
21 22 23 |
# File 'app/models/effective/resources/generator.rb', line 21 def module_namespaced (Array(namespaces).map { |name| name.to_s.classify } + [plural_name.classify.pluralize]) * '::' end |
#namespaced_class_name ⇒ Object
‘Admin::Effective::Post’
25 26 27 |
# File 'app/models/effective/resources/generator.rb', line 25 def namespaced_class_name # 'Admin::Effective::Post' (Array(namespaces).map { |name| name.to_s.classify } + [class_name]) * '::' end |
#namespaced_module_name ⇒ Object
‘Admin::EffectivePosts’
29 30 31 |
# File 'app/models/effective/resources/generator.rb', line 29 def namespaced_module_name # 'Admin::EffectivePosts' Array(namespaces).map { |name| name.to_s.classify }.join('::') + '::' + class_name.gsub('::', '') end |
#tenant_class_name ⇒ Object
46 47 48 |
# File 'app/models/effective/resources/generator.rb', line 46 def tenant_class_name (Tenant.module_name + '::' + class_name) if tenant? end |
#tenant_controller_path ⇒ Object
Tenants
34 35 36 |
# File 'app/models/effective/resources/generator.rb', line 34 def tenant_controller_path (Tenant.module_name.downcase + '/' + controller_path) if tenant? end |
#tenant_namespaced_class_name ⇒ Object
38 39 40 |
# File 'app/models/effective/resources/generator.rb', line 38 def tenant_namespaced_class_name (Tenant.module_name + '::' + namespaced_class_name) if tenant? end |
#tenant_namespaced_module_name ⇒ Object
42 43 44 |
# File 'app/models/effective/resources/generator.rb', line 42 def tenant_namespaced_module_name (Tenant.module_name + '::' + namespaced_module_name) if tenant? end |