Class: BuildMaster::FileContent
- Inherits:
-
Object
- Object
- BuildMaster::FileContent
- Defined in:
- lib/buildmaster/cotta/in_memory_system.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #copy_to_dir(system, parent_dir, target_dir) ⇒ Object
- #directory? ⇒ Boolean
- #file? ⇒ Boolean
-
#initialize(name) ⇒ FileContent
constructor
A new instance of FileContent.
- #size ⇒ Object
Constructor Details
#initialize(name) ⇒ FileContent
Returns a new instance of FileContent.
215 216 217 218 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 215 def initialize(name) @name = name @content = '' end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
212 213 214 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 212 def content @content end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
212 213 214 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 212 def name @name end |
Instance Method Details
#copy_to_dir(system, parent_dir, target_dir) ⇒ Object
232 233 234 235 236 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 232 def copy_to_dir(system, parent_dir, target_dir) target_path = target_dir.join(name) source_path = parent_dir.join(name) system.copy_file(source_path, target_path) end |
#directory? ⇒ Boolean
224 225 226 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 224 def directory? return false end |
#file? ⇒ Boolean
220 221 222 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 220 def file? return true end |
#size ⇒ Object
228 229 230 |
# File 'lib/buildmaster/cotta/in_memory_system.rb', line 228 def size content.size end |