Class: Aws::Templates::Help::Aggregate

Inherits:
Provider show all
Defined in:
lib/aws/templates/help/aggregate.rb

Overview

Aggregated documentation provider

A composite which generates documentation for entities which have a few documentation aspects which must be assembled in the resulting piece. Documentation aspects must have their own documentation providers. Aggregate will assemble them all according to the specified ordering.

Direct Known Subclasses

Rdoc::Artifact, Rdoc::Parametrized::Nested

Instance Attribute Summary

Attributes inherited from Processor::Handler

#context, #parameters

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Processor::Handler

for_entity, #handler_for, #in_context, #initialize, #processed_for, processor, #processor, register_in

Constructor Details

This class inherits a constructor from Aws::Templates::Processor::Handler

Class Method Details

.after(*mods) ⇒ Object

DSL to declare aspects which should be displayed after entity-specific fragment



20
21
22
# File 'lib/aws/templates/help/aggregate.rb', line 20

def self.after(*mods)
  after_providers.concat(get_handlers_for(mods))
end

.after_providersObject

The list of aspects to be displayed after entity-specific fragment



30
31
32
# File 'lib/aws/templates/help/aggregate.rb', line 30

def self.after_providers
  @after_providers ||= superclass < Aggregate ? superclass.after_providers.dup : []
end

.before(*mods) ⇒ Object

DSL to declare aspects which should be displayed before entity-specific fragment



15
16
17
# File 'lib/aws/templates/help/aggregate.rb', line 15

def self.before(*mods)
  before_providers.concat(get_handlers_for(mods))
end

.before_providersObject

The list of aspects to be displayed before entity-specific fragment



25
26
27
# File 'lib/aws/templates/help/aggregate.rb', line 25

def self.before_providers
  @before_providers ||= superclass < Aggregate ? superclass.before_providers.dup : []
end

.get_handlers_for(mods) ⇒ Object

Get list of aspect handlers for the list of classes/modules



45
46
47
# File 'lib/aws/templates/help/aggregate.rb', line 45

def self.get_handlers_for(mods)
  mods.map { |mod| processor.handler_for(mod) }
end

Instance Method Details

#provideObject



34
35
36
37
38
39
40
41
42
# File 'lib/aws/templates/help/aggregate.rb', line 34

def provide
  fragments = _process_through(self.class.before_providers)
              .push(fragment)
              .concat(_process_through(self.class.after_providers))

  fragments.compact!

  compose(fragments) unless fragments.empty?
end