module Rapper::ViewHelpers

View helpers.

Constants

RAPPER

Public Class Methods

included( klass ) click to toggle source
# File lib/rapper/helpers.rb, line 26
def self.included( klass )
  klass.class_eval do
    # Define a "include_FOO" method for each definition type. For example,
    # if you have "stylesheets" and "javascripts" definitions, you'll have
    # "include_stylesheets( name )" and "include_javascripts( name )"
    # methods.
    RAPPER.definitions.each do |type, definition|
      tag_method = RAPPER.tag_method_for_type( type )
      define_method "include_#{type}".to_sym do |name|
        RAPPER.send( tag_method, type, name )
      end
    end
  end
end