Sha256: d1ac49465de3ec12691e8bd355c82e8d7d62440bd7a5d38195ecb77fadbff482

Contents?: true

Size: 639 Bytes

Versions: 12

Compression:

Stored size: 639 Bytes

Contents

module ExpressTemplates
  module Components
    module Capabilities

      # Adds the capability for a component to render itself in a context.
      #
      # Provides both:
      #
      # * Rendering::ClassMethods
      # * Rendering::InstanceMethods
      #
      # Used in ExpressTemplates::Components::Base.
      #
      module Rendering
        def self.included(base)
          base.class_eval do
            extend ClassMethods
          end
        end

        module ClassMethods
          def render_in(context, &view_code)
            context.instance_eval(&view_code)
          end
        end

      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/capabilities/rendering.rb
express_admin-1.2.0 vendor/gems/express_templates/lib/express_templates/components/capabilities/rendering.rb
express_templates-0.5.0 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.4.2 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.4.1 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.4.0 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.3.6 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.3.5 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.3.4 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.3.2 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.3.1 lib/express_templates/components/capabilities/rendering.rb
express_templates-0.3.0 lib/express_templates/components/capabilities/rendering.rb