Class: Kms::ResourceService
- Inherits:
-
Object
- Object
- Kms::ResourceService
- Defined in:
- app/services/kms/resource_service.rb
Constant Summary collapse
Class Method Summary collapse
- .external_resources_hash ⇒ Object
- .register(group, resource, tab_icon_class) ⇒ Object
- .unregister(group, resource) ⇒ Object
Class Method Details
.external_resources_hash ⇒ Object
18 19 20 21 22 |
# File 'app/services/kms/resource_service.rb', line 18 def self.external_resources_hash self.resources.values.map(&:keys).flatten.reject {|r| NON_TEMPLATABLE_CLASSES.include?(r)}.map do |resource_class| {type: resource_class.name, title: resource_class.model_name.human} end end |
.register(group, resource, tab_icon_class) ⇒ Object
9 10 11 12 |
# File 'app/services/kms/resource_service.rb', line 9 def self.register(group, resource, tab_icon_class) self.resources[group] ||= {} self.resources[group][resource] = tab_icon_class end |
.unregister(group, resource) ⇒ Object
14 15 16 |
# File 'app/services/kms/resource_service.rb', line 14 def self.unregister(group, resource) self.resources[group].delete(resource) end |