Class: EacRubyUtils::Templates::Directory::TemplateNode

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


50
51
52
53
54
55
# File 'lib/eac_ruby_utils/templates/directory.rb', line 50

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


48
49
50
# File 'lib/eac_ruby_utils/templates/directory.rb', line 48

def source_directory
  @source_directory
end

#source_relativeObject (readonly)

Returns the value of attribute source_relative


48
49
50
# File 'lib/eac_ruby_utils/templates/directory.rb', line 48

def source_relative
  @source_relative
end

#target_root_directoryObject (readonly)

Returns the value of attribute target_root_directory


48
49
50
# File 'lib/eac_ruby_utils/templates/directory.rb', line 48

def target_root_directory
  @target_root_directory
end

#variables_sourceObject (readonly)

Returns the value of attribute variables_source


48
49
50
# File 'lib/eac_ruby_utils/templates/directory.rb', line 48

def variables_source
  @variables_source
end

Instance Method Details

#applyObject


57
58
59
60
61
62
63
64
65
# File 'lib/eac_ruby_utils/templates/directory.rb', line 57

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