Class: Avm::Files::Appendable::TemplatizedDirectory
- Inherits:
-
ResourceBase
- Object
- ResourceBase
- Avm::Files::Appendable::TemplatizedDirectory
- Defined in:
- lib/avm/files/appendable/templatized_directory.rb
Instance Method Summary collapse
- #applier ⇒ Object
- #applier_from_path ⇒ EacTemplates::Variables::Directory
- #to_s_attributes ⇒ Enumerable<Symbol>
- #write_on(target_dir) ⇒ Object
Methods inherited from ResourceBase
Instance Method Details
#applier ⇒ Object
14 15 16 17 18 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 14 def applier return source_path if source_path.respond_to?(:apply) applier_from_path end |
#applier_from_path ⇒ EacTemplates::Variables::Directory
21 22 23 24 25 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 21 def applier_from_path raise "\"#{source_path}\" is not a directory" unless ::File.directory?(source_path) ::EacTemplates::Variables::Directory.new(source_path) end |
#to_s_attributes ⇒ Enumerable<Symbol>
34 35 36 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 34 def to_s_attributes [:source_path] end |
#write_on(target_dir) ⇒ Object
27 28 29 30 31 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 27 def write_on(target_dir) raise 'Variables source not set' if appender.variables_source.blank? applier.apply(appender.variables_source, target_dir) end |