Class: Templater

Inherits:
Object
  • Object
show all
Defined in:
lib/yesman/templater.rb

Instance Method Summary collapse

Instance Method Details

#apply_class_to_templateObject



18
19
20
# File 'lib/yesman/templater.rb', line 18

def apply_class_to_template
  @output = @loaded_template.result( @class_type.get_binding ) 
end

#load_templateObject



14
15
16
# File 'lib/yesman/templater.rb', line 14

def load_template
  @loaded_template = ERB.new File.read( @template_path )
end

#merge(class_type, template_path) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/yesman/templater.rb', line 5

def merge class_type, template_path
  @class_type = class_type
  @template_path = template_path

  load_template
  apply_class_to_template
  @output
end