Class: Avm::Files::Appendable::TemplatizedDirectory

Inherits:
ResourceBase
  • Object
show all
Defined in:
lib/avm/files/appendable/templatized_directory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(appender, source_path) ⇒ TemplatizedDirectory

Returns a new instance of TemplatizedDirectory.



13
14
15
16
# File 'lib/avm/files/appendable/templatized_directory.rb', line 13

def initialize(appender, source_path)
  super(appender)
  @source_path = source_path
end

Instance Attribute Details

#source_pathObject (readonly)

Returns the value of attribute source_path.



11
12
13
# File 'lib/avm/files/appendable/templatized_directory.rb', line 11

def source_path
  @source_path
end

Instance Method Details

#write_on(target_dir) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/avm/files/appendable/templatized_directory.rb', line 18

def write_on(target_dir)
  raise 'Variables source not set' if appender.variables_source.blank?

  ::EacTemplates::Directory.new(source_path).apply(
    appender.variables_source,
    target_dir
  )
end