module Aws::Templates::Processor

Abstract processor

Processors are used in artifacts rendering and help generators. Processor embodies functionality required to register an entity handler and look-up the registry when the entity is processed.

Public Instance Methods

define_handler(entity, handler, &blk) click to toggle source

Define handler for entity

Another way to define handlers for entities. Creates anonymous class and attaches as the handler to the specified entity.

# File lib/aws/templates/processor.rb, line 39
def define_handler(entity, handler, &blk)
  Class.new(handler, &blk).register_in(self).for_entity(entity)
end
handler?(*args) click to toggle source

Proxy for Registry handler? method

# File lib/aws/templates/processor.rb, line 22
def handler?(*args)
  registry.handler?(*args)
end
handler_for(*args) click to toggle source

Proxy for Registry handler_for method

# File lib/aws/templates/processor.rb, line 16
def handler_for(*args)
  registry.handler_for(*args)
end
process(_entity, _params = nil) click to toggle source

Handlder look-up logic.

Should provide logic for processing entities.

# File lib/aws/templates/processor.rb, line 30
def process(_entity, _params = nil)
  raise Templates::Exception::NotImplementedError.new('The method should be overriden')
end
routing(routes) click to toggle source

Add handlers

Add routing between handlers and correspondent entities from another entity which supports routing concept.

# File lib/aws/templates/processor.rb, line 48
def routing(routes)
  registry.merge(routes.registry)
end