Class: TemplateBuilder

Inherits:
Object
  • Object
show all
Defined in:
app/templates/install/builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ TemplateBuilder

Returns a new instance of TemplateBuilder.



6
7
8
# File 'app/templates/install/builder.rb', line 6

def initialize(root)
  @root = root
end

Instance Attribute Details

#rootObject (readonly)

Returns the value of attribute root.



4
5
6
# File 'app/templates/install/builder.rb', line 4

def root
  @root
end

Instance Method Details

#embed(path) ⇒ Object



21
22
23
# File 'app/templates/install/builder.rb', line 21

def embed(path)
  File.read(File.join(root, path))
end

#embed_code(path) ⇒ Object



14
15
16
17
18
19
# File 'app/templates/install/builder.rb', line 14

def embed_code(path)
  contents = File.read(File.join(root, path))
  %Q(<<-CODE
#{contents}
CODE)
end

#get_bindingObject



10
11
12
# File 'app/templates/install/builder.rb', line 10

def get_binding
  binding
end