Class: Pot::Template

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

Instance Method Summary collapse

Constructor Details

#initialize(package, name) ⇒ Template

Returns a new instance of Template.



3
4
5
6
# File 'lib/pot/template.rb', line 3

def initialize(package, name)
  @package = package
  @name = name
end

Instance Method Details

#pathObject



8
9
10
11
12
# File 'lib/pot/template.rb', line 8

def path
  default_file_path = File.join(templates_directory, 'defaults', @package.name.to_s, @name.to_s)
  raise "Can't read template #{default_file_path}" unless File.readable?(default_file_path)
  default_file_path
end