Module: Mime

Defined in:
lib/mime-components.rb,
lib/mime-components/engine/engine.rb,
lib/mime-components/engine/render.rb,
lib/mime-components/engine/globals.rb,
lib/mime-components/extensions/erb.rb,
lib/mime-components/components/builtins.rb,
lib/mime-components/components/components.rb

Overview

Mime is a component (not templating!) system based on XML tags (components).

Defined Under Namespace

Classes: Component, ERBComponent, Engine

Class Method Summary collapse

Class Method Details

.register_defaults(engine) ⇒ Object

Register default components to an engine. This is done when an engine is initialized and generally should not be done externally.

Parameters:

  • engine (Mime::Engine)

    engine to register default components to



9
10
11
12
13
14
15
16
# File 'lib/mime-components/components/builtins.rb', line 9

def self.register_defaults(engine)
   component_variable = Mime::Component.new('Variable') do |attributes, vars|
      value = vars[attributes[:name].to_s.to_sym]
      value = Erubi.h(value) unless Component.attr_true?(attributes[:raw])
      value
   end
   engine.register_component(component_variable)
end