Module: Model::MetaController
- Extended by:
- ActiveSupport::Concern
- Included in:
- Com::MetaController
- Defined in:
- app/models/com/model/meta_controller.rb
Instance Method Summary collapse
- #business_name ⇒ Object
- #identifier ⇒ Object
- #name ⇒ Object
- #namespace_name ⇒ Object
- #role_hash ⇒ Object
- #role_path ⇒ Object
Instance Method Details
#business_name ⇒ Object
36 37 38 39 40 41 |
# File 'app/models/com/model/meta_controller.rb', line 36 def business_name t = I18n.t "#{business_identifier}.title", default: nil return t if t business_identifier end |
#identifier ⇒ Object
32 33 34 |
# File 'app/models/com/model/meta_controller.rb', line 32 def identifier [business_identifier, namespace_identifier, (controller_path.blank? ? '_' : controller_path)].join('_') end |
#name ⇒ Object
50 51 52 53 54 55 |
# File 'app/models/com/model/meta_controller.rb', line 50 def name t = I18n.t "#{controller_path.to_s.split('/').join('.')}.index.title", default: nil return t if t controller_path end |
#namespace_name ⇒ Object
43 44 45 46 47 48 |
# File 'app/models/com/model/meta_controller.rb', line 43 def namespace_name t = I18n.t "#{business_identifier}.#{namespace_identifier}.title", default: nil return t if t namespace_identifier end |
#role_hash ⇒ Object
65 66 67 |
# File 'app/models/com/model/meta_controller.rb', line 65 def role_hash .each_with_object({}) { |i, h| h.merge! i.action_name => i.role_hash } end |
#role_path ⇒ Object
57 58 59 60 61 62 63 |
# File 'app/models/com/model/meta_controller.rb', line 57 def role_path { business_identifier => { namespace_identifier => { controller_path => role_hash } } } end |