Class: TemplateBuilder
- Inherits:
-
Object
- Object
- TemplateBuilder
- Defined in:
- app/templates/install/builder.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #embed(path) ⇒ Object
- #embed_code(path) ⇒ Object
- #get_binding ⇒ Object
-
#initialize(root) ⇒ TemplateBuilder
constructor
A new instance of TemplateBuilder.
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
#root ⇒ Object (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 (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 (path) contents = File.read(File.join(root, path)) %Q(<<-CODE #{contents} CODE) end |
#get_binding ⇒ Object
10 11 12 |
# File 'app/templates/install/builder.rb', line 10 def get_binding binding end |