Sha256: f11a872964d81f2989106beaf81e4e45cffd19324ea66d8a72c2357fa7d8aba6

Contents?: true

Size: 874 Bytes

Versions: 4

Compression:

Stored size: 874 Bytes

Contents

#          Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
# All files in this distribution are subject to the terms of the Ruby license.

require 'ramaze/trinity'

module Ramaze

  # A module used by the Templates and the Controllers
  # it provides both Ramaze::Trinity (request/response/session)
  # and also a helper method, look below for more information about it

  module Helper
    include Trinity

    private

    # This loads the helper-files from /ramaze/helper/helpername.rb and
    # includes it into Ramaze::Template (or wherever it is called)
    #
    # Usage:
    #   helper :redirect, :link

    def helper *syms
      syms.each do |sym|
        mod_name = sym.to_s.capitalize + 'Helper'
        require("ramaze/helper/"/sym)
        include ::Ramaze.const_get(mod_name)
        extend ::Ramaze.const_get(mod_name)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ramaze-0.1.1 lib/ramaze/helper.rb
ramaze-0.1.4 lib/ramaze/helper.rb
ramaze-0.1.2 lib/ramaze/helper.rb
ramaze-0.1.3 lib/ramaze/helper.rb