Class: EacTemplates::Directory::TemplateNode

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_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.



49
50
51
52
53
54
# File 'lib/eac_templates/directory.rb', line 49

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.



47
48
49
# File 'lib/eac_templates/directory.rb', line 47

def source_directory
  @source_directory
end

#source_relativeObject (readonly)

Returns the value of attribute source_relative.



47
48
49
# File 'lib/eac_templates/directory.rb', line 47

def source_relative
  @source_relative
end

#target_root_directoryObject (readonly)

Returns the value of attribute target_root_directory.



47
48
49
# File 'lib/eac_templates/directory.rb', line 47

def target_root_directory
  @target_root_directory
end

#variables_sourceObject (readonly)

Returns the value of attribute variables_source.



47
48
49
# File 'lib/eac_templates/directory.rb', line 47

def variables_source
  @variables_source
end

Instance Method Details

#applyObject



56
57
58
59
60
61
62
63
64
# File 'lib/eac_templates/directory.rb', line 56

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