class Tilt::RadiusTemplate
Radius Template
github.com/jlong/radius/
Public Class Methods
context_class()
click to toggle source
# File lib/tilt/radius.rb 8 def self.context_class 9 @context_class ||= Class.new(Radius::Context) do 10 attr_accessor :tilt_scope 11 12 def tag_missing(name, attributes) 13 tilt_scope.__send__(name) 14 end 15 16 def dup 17 i = super 18 i.tilt_scope = tilt_scope 19 i 20 end 21 end 22 end
Public Instance Methods
allows_script?()
click to toggle source
# File lib/tilt/radius.rb 44 def allows_script? 45 false 46 end
dup()
click to toggle source
Calls superclass method
# File lib/tilt/radius.rb 16 def dup 17 i = super 18 i.tilt_scope = tilt_scope 19 i 20 end
evaluate(scope, locals, &block)
click to toggle source
# File lib/tilt/radius.rb 27 def evaluate(scope, locals, &block) 28 context = self.class.context_class.new 29 context.tilt_scope = scope 30 context.define_tag("yield") do 31 block.call 32 end 33 locals.each do |tag, value| 34 context.define_tag(tag) do 35 value 36 end 37 end 38 39 options = {:tag_prefix => 'r'}.merge(@options) 40 parser = Radius::Parser.new(context, options) 41 parser.parse(data) 42 end
prepare()
click to toggle source
# File lib/tilt/radius.rb 24 def prepare 25 end
tag_missing(name, attributes)
click to toggle source
# File lib/tilt/radius.rb 12 def tag_missing(name, attributes) 13 tilt_scope.__send__(name) 14 end