Class: ESA::SubcontextChecker
- Inherits:
-
Object
- Object
- ESA::SubcontextChecker
- Defined in:
- lib/esa/subcontext_checker.rb
Class Method Summary collapse
Class Method Details
.check(context, options = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/esa/subcontext_checker.rb', line 15 def self.check(context, = {}) providers(context, ).each do |namespace,provider| if provider.is_a? Class and provider.respond_to? :check_subcontexts provider.check_subcontexts(context, namespace) elsif provider.respond_to? :count and provider.count == 2 and provider[0].is_a? Class and provider[0].respond_to? :check_subcontexts and provider[1].is_a? Hash provider_klass, = provider provider_klass.check_subcontexts(context, namespace, ) end end end |
.providers(context, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/esa/subcontext_checker.rb', line 3 def self.providers(context, = {}) if :namespace.in? if [:namespace].respond_to? :each ESA.configuration.context_providers.slice(*[:namespace]) else ESA.configuration.context_providers.slice("#{[:namespace]}") end else ESA.configuration.context_providers_for_path(context.effective_path) end end |