Class: RunLoop::UIAScriptTemplate

Inherits:
ERB
  • Object
show all
Defined in:
lib/run_loop/template.rb

Overview

class to break up javascript templates in to reusable chunks

Instance Method Summary collapse

Constructor Details

#initialize(template_root, template_relative_path) ⇒ UIAScriptTemplate


7
8
9
10
11
# File 'lib/run_loop/template.rb', line 7

def initialize(template_root, template_relative_path)
  @template_root = template_root
  @template = File.read(File.join(@template_root, template_relative_path))
  super(@template)
end

Instance Method Details

#render_template(template_relative_path) ⇒ Object


13
14
15
# File 'lib/run_loop/template.rb', line 13

def render_template(template_relative_path)
  return UIAScriptTemplate.new(@template_root, template_relative_path).result
end

#resultObject


17
18
19
# File 'lib/run_loop/template.rb', line 17

def result
  super(binding)
end