Class: LetterGenerator::OutputFile

Inherits:
Object
  • Object
show all
Defined in:
lib/letter_generator/output_file.rb

Instance Method Summary collapse

Constructor Details

#initialize(template) ⇒ OutputFile

Returns a new instance of OutputFile.



9
10
11
# File 'lib/letter_generator/output_file.rb', line 9

def initialize(template)
  @template = Tilt::ErubisTemplate.new{ template }
end

Instance Method Details

#path_for(object) ⇒ Object



13
14
15
# File 'lib/letter_generator/output_file.rb', line 13

def path_for(object)
  Pathname.new(File.expand_path(template.render(object.to_s.characterize)))
end