Class: Aws::Templates::Render::BasicView

Inherits:
Processor::Handler show all
Defined in:
lib/aws/templates/render/basic_view.rb

Overview

Basic render view

Views are classes encapsulating functionality of transforming artifacts into domain-specific output. For instance, the same LDAP record can be transformed into JSON description or LDIF definition. Views can be attached to ancestors of an artifact and it expected that the library will look-up the closest ancestor having view attached if the render is invoked on a child.

Each view is attached to a registry object which stores correspondence between artifact classes and their views, and optionally to an artifact. A view is registered in a registry only when it is attached to an artifact. Views depend on artifacts but artifacts are not aware of views. As the extreme case, a sole view can be attached to Artifact if you have universal way to render your domain objects.

Views are regular Ruby classes and all assumptions made about polymorphism, inheritance and incapsulation are true for them.

View class itself is an abstract class which can’t be instantiated directly.

Instance Attribute Summary

Attributes inherited from Processor::Handler

#context, #parameters

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

Instance Method Details

#to_renderedObject

Render the instance of the artifact

The method should be overriden and return rendered form of the attached instance

Raises:

  • (Templates::Exception::NotImplementedError)


41
42
43
# File 'lib/aws/templates/render/basic_view.rb', line 41

def to_rendered
  raise Templates::Exception::NotImplementedError.new('The method should be overriden')
end