Class: Llama::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/llama/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, template_name) ⇒ Project

Returns a new instance of Project.



5
6
7
8
# File 'lib/llama/project.rb', line 5

def initialize(name, template_name)
  @name = name
  @template = Llama::Template.new(template_name)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/llama/project.rb', line 3

def name
  @name
end

#templateObject

Returns the value of attribute template.



3
4
5
# File 'lib/llama/project.rb', line 3

def template
  @template
end

Instance Method Details

#pathObject



14
15
16
# File 'lib/llama/project.rb', line 14

def path
  File.join(Dir.pwd, name)
end

#write_template!Object



10
11
12
# File 'lib/llama/project.rb', line 10

def write_template!
  template.render!(path, name)
end