class Aws::Templates::Render::BasicView

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.

Public Instance Methods

to_rendered() click to toggle source

Render the instance of the artifact

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

# File lib/aws/templates/render/basic_view.rb, line 41
def to_rendered
  raise Templates::Exception::NotImplementedError.new('The method should be overriden')
end