Class: Avm::Templates::Directory::TemplateNode

Inherits:
Object
  • Object
show all
Defined in:
lib/avm/templates/directory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_directory, source_relative, target_root_directory, variables_source) ⇒ TemplateNode

Returns a new instance of TemplateNode.



36
37
38
39
40
41
# File 'lib/avm/templates/directory.rb', line 36

def initialize(source_directory, source_relative, target_root_directory, variables_source)
  @source_directory = source_directory
  @source_relative = source_relative
  @target_root_directory = target_root_directory
  @variables_source = variables_source
end

Instance Attribute Details

#source_directoryObject (readonly)

Returns the value of attribute source_directory.



34
35
36
# File 'lib/avm/templates/directory.rb', line 34

def source_directory
  @source_directory
end

#source_relativeObject (readonly)

Returns the value of attribute source_relative.



34
35
36
# File 'lib/avm/templates/directory.rb', line 34

def source_relative
  @source_relative
end

#target_root_directoryObject (readonly)

Returns the value of attribute target_root_directory.



34
35
36
# File 'lib/avm/templates/directory.rb', line 34

def target_root_directory
  @target_root_directory
end

#variables_sourceObject (readonly)

Returns the value of attribute variables_source.



34
35
36
# File 'lib/avm/templates/directory.rb', line 34

def variables_source
  @variables_source
end

Instance Method Details

#applyObject



43
44
45
46
47
48
49
50
51
# File 'lib/avm/templates/directory.rb', line 43

def apply
  if file?
    apply_file
  elsif directory?
    apply_directory
  else
    raise "Unknown filesystem type: #{source_absolute}"
  end
end