Class: Avm::Files::Appendable::FileContent

Inherits:
ResourceBase show all
Defined in:
lib/avm/files/appendable/file_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ResourceBase

#to_s

Constructor Details

#initialize(deploy, target_path, content) ⇒ FileContent

Returns a new instance of FileContent.



9
10
11
12
13
# File 'lib/avm/files/appendable/file_content.rb', line 9

def initialize(deploy, target_path, content)
  super(deploy)
  @target_path = target_path
  @content = content
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



7
8
9
# File 'lib/avm/files/appendable/file_content.rb', line 7

def content
  @content
end

#target_pathObject (readonly)

Returns the value of attribute target_path.



7
8
9
# File 'lib/avm/files/appendable/file_content.rb', line 7

def target_path
  @target_path
end

Instance Method Details

#write_on(target_dir) ⇒ Object



15
16
17
# File 'lib/avm/files/appendable/file_content.rb', line 15

def write_on(target_dir)
  target_dir.join(target_path).write(content)
end