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
10 11 12 13 14 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 10 def applier return source_path if source_path.respond_to?(:apply) applier_from_path end |
#applier_from_path ⇒ EacTemplates::Variables::Directory
17 18 19 20 21 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 17 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>
30 31 32 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 30 def to_s_attributes [:source_path] end |
#write_on(target_dir) ⇒ Object
23 24 25 26 27 |
# File 'lib/avm/files/appendable/templatized_directory.rb', line 23 def write_on(target_dir) raise 'Variables source not set' if appender.variables_source.blank? applier.apply(appender.variables_source, target_dir) end |