Module: Ramaze::Helper::Methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extend_object(other) ⇒ Object



27
28
29
30
# File 'lib/ramaze/helper.rb', line 27

def self.extend_object other
  other.send :extend, Trinity
  super
end

.included(other) ⇒ Object



20
21
22
23
24
25
# File 'lib/ramaze/helper.rb', line 20

def self.included other
  other.send :extend, Trinity
  other.send :extend, Methods
  other.send :include, Trinity
  super
end

Instance Method Details

#helper(*syms) ⇒ Object

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


38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/ramaze/helper.rb', line 38

def helper(*syms)
  syms.each do |sym|
    name = sym.to_s
    if mod = find_helper(name)
      use_helper(mod)
    else
      if require_helper(name)
        redo
      else
        raise LoadError, "#{name} not found"
      end
    end
  end
end