Sha256: f76401f4e1509ae6e7c9d8ca25fad9f84d54022bddfae7b292b0f853faf12426

Contents?: true

Size: 1.87 KB

Versions: 12

Compression:

Stored size: 1.87 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 < Expander
      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

12 entries across 12 versions & 2 rubygems

Version Path
express_admin-1.2.1 vendor/gems/express_templates/lib/express_templates/components/base.rb
express_admin-1.2.0 vendor/gems/express_templates/lib/express_templates/components/base.rb
express_templates-0.5.0 lib/express_templates/components/base.rb
express_templates-0.4.2 lib/express_templates/components/base.rb
express_templates-0.4.1 lib/express_templates/components/base.rb
express_templates-0.4.0 lib/express_templates/components/base.rb
express_templates-0.3.6 lib/express_templates/components/base.rb
express_templates-0.3.5 lib/express_templates/components/base.rb
express_templates-0.3.4 lib/express_templates/components/base.rb
express_templates-0.3.2 lib/express_templates/components/base.rb
express_templates-0.3.1 lib/express_templates/components/base.rb
express_templates-0.3.0 lib/express_templates/components/base.rb