Class Tilt::MarkabyTemplate
In: lib/tilt/markaby.rb
Parent: Template

Methods

Public Class methods

[Source]

    # File lib/tilt/markaby.rb, line 7
 7:     def self.builder_class
 8:       @builder_class ||= Class.new(Markaby::Builder) do
 9:         def __capture_markaby_tilt__(&block)
10:           __run_markaby_tilt__ do
11:             text capture(&block)
12:           end
13:         end
14:       end
15:     end

[Source]

    # File lib/tilt/markaby.rb, line 17
17:     def self.engine_initialized?
18:       defined? ::Markaby
19:     end

Public Instance methods

[Source]

    # File lib/tilt/markaby.rb, line 9
 9:         def __capture_markaby_tilt__(&block)
10:           __run_markaby_tilt__ do
11:             text capture(&block)
12:           end
13:         end

[Source]

    # File lib/tilt/markaby.rb, line 28
28:     def evaluate(scope, locals, &block)
29:       builder = self.class.builder_class.new({}, scope)
30:       builder.locals = locals
31: 
32:       if data.kind_of? Proc
33:         (class << builder; self end).send(:define_method, :__run_markaby_tilt__, &data)
34:       else
35:         builder.instance_eval "def __run_markaby_tilt__\n\#{data}\nend\n", __FILE__, __LINE__
36:       end
37: 
38:       if block
39:         builder.__capture_markaby_tilt__(&block)
40:       else
41:         builder.__run_markaby_tilt__
42:       end
43: 
44:       builder.to_s
45:     end

[Source]

    # File lib/tilt/markaby.rb, line 21
21:     def initialize_engine
22:       require_template_library 'markaby'
23:     end

[Source]

    # File lib/tilt/markaby.rb, line 25
25:     def prepare
26:     end

[Validate]