Class: ExpressTemplates::Components::Base

Inherits:
Expander
  • Object
show all
Includes:
Capabilities::Iterating, Capabilities::Rendering, Capabilities::Templating, Capabilities::Wrapping, Macro
Defined in:
lib/express_templates/components/base.rb

Overview

Components::Base is the base class for ExpressTemplates view components.

View components are available as macros in ExpressTemplates and may be used to encapsulate common view patterns, behavior and functionality in reusable classes that can be shared within and across projects.

Components intended to provide a base framework for a library of reusable components to cut development time across a multitude of projects.

Components gain their functionality through including Capabilities.

Example capabilities include:

  • Managing related ExpressTemplate fragments

  • Compiling template fragments for evaluation in a View Context

  • Specifying rendering logic to be executed in the View Context

  • Potentially referencing external assets that may be required for the component to work.

Components::Base includes the following capabilities:

  • Capabilities::Templating

  • Capabilities::Rendering

  • Capabilities::Wrapping

  • Capabilities::Iterating

Direct Known Subclasses

Container, FormRailsSupport, TableFor

Instance Attribute Summary

Attributes inherited from Expander

#handlers, #locals, #stack

Class Method Summary collapse

Methods included from Capabilities::Iterating

included

Methods included from Capabilities::Wrapping

included

Methods included from Capabilities::Rendering

included

Methods included from Capabilities::Templating

included

Methods included from Macro

included

Methods inherited from Expander

#expand, #initialize, #initialize_expander, #method_missing, #process_children!, register_macros_for

Constructor Details

This class inherits a constructor from ExpressTemplates::Expander

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ExpressTemplates::Expander

Class Method Details

.inherited(klass) ⇒ Object



47
48
49
# File 'lib/express_templates/components/base.rb', line 47

def self.inherited(klass)
  ExpressTemplates::Expander.register_macros_for klass
end