Sha256: 5f5d1ce2f25fbb62b24b44c22aecb80b427b79c46734b2f0b8c4d5d489c800ff

Contents?: true

Size: 1.86 KB

Versions: 6

Compression:

Stored size: 1.86 KB

Contents

capabilities = Dir.glob(File.join(File.dirname(__FILE__), 'capabilities', '*.rb'))
capabilities.each {|capability| require capability}

module ExpressTemplates
  # Components provide self-contained reusable view code meant to be shared
  # within a project or across many projects through a library of components
  #
  # Components gain their functionality through inclusion of Capabilities.
  #
  # Most Components are descendents of Components::Base.
  #
  module Components

    # 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
    #
    class Base
      include ExpressTemplates::Macro
      include Capabilities::Templating
      include Capabilities::Rendering
      include Capabilities::Wrapping
      include Capabilities::Iterating

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

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
express_templates-0.2.7 lib/express_templates/components/base.rb
express_templates-0.2.6 lib/express_templates/components/base.rb
express_templates-0.2.5 lib/express_templates/components/base.rb
express_templates-0.2.4 lib/express_templates/components/base.rb
express_templates-0.2.3 lib/express_templates/components/base.rb
express_templates-0.2.2 lib/express_templates/components/base.rb