Class: EacTemplates::Directory::TemplateNode
- Defined in:
- lib/eac_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.
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_directory ⇒ Object (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_relative ⇒ Object (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_directory ⇒ Object (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_source ⇒ Object (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
#apply ⇒ Object
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 |