Class: EacRubyUtils::Templates::Directory::TemplateNode
- Defined in:
- lib/eac_ruby_utils/templates/directory.rb
Instance Attribute Summary collapse
-
#source_directory ⇒ Object
readonly
Returns the value of attribute source_directory.
-
#source_relative ⇒ Object
readonly
Returns the value of attribute source_relative.
-
#target_root_directory ⇒ Object
readonly
Returns the value of attribute target_root_directory.
-
#variables_source ⇒ Object
readonly
Returns the value of attribute variables_source.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(source_directory, source_relative, target_root_directory, variables_source) ⇒ TemplateNode
constructor
A new instance of TemplateNode.
Constructor Details
#initialize(source_directory, source_relative, target_root_directory, variables_source) ⇒ TemplateNode
Returns a new instance of TemplateNode.
44 45 46 47 48 49 |
# File 'lib/eac_ruby_utils/templates/directory.rb', line 44 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_directory ⇒ Object (readonly)
Returns the value of attribute source_directory.
42 43 44 |
# File 'lib/eac_ruby_utils/templates/directory.rb', line 42 def source_directory @source_directory end |
#source_relative ⇒ Object (readonly)
Returns the value of attribute source_relative.
42 43 44 |
# File 'lib/eac_ruby_utils/templates/directory.rb', line 42 def source_relative @source_relative end |
#target_root_directory ⇒ Object (readonly)
Returns the value of attribute target_root_directory.
42 43 44 |
# File 'lib/eac_ruby_utils/templates/directory.rb', line 42 def target_root_directory @target_root_directory end |
#variables_source ⇒ Object (readonly)
Returns the value of attribute variables_source.
42 43 44 |
# File 'lib/eac_ruby_utils/templates/directory.rb', line 42 def variables_source @variables_source end |
Instance Method Details
#apply ⇒ Object
51 52 53 54 55 56 57 58 59 |
# File 'lib/eac_ruby_utils/templates/directory.rb', line 51 def apply if file? apply_file elsif directory? apply_directory else raise "Unknown filesystem type: #{source_absolute}" end end |