Class: Bunto::Compose::FileCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/bunto-compose/file_creator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fileInfo, force = false) ⇒ FileCreator

Returns a new instance of FileCreator.



5
6
7
8
# File 'lib/bunto-compose/file_creator.rb', line 5

def initialize(fileInfo, force = false)
  @file = fileInfo
  @force = force
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



4
5
6
# File 'lib/bunto-compose/file_creator.rb', line 4

def file
  @file
end

#forceObject (readonly)

Returns the value of attribute force.



4
5
6
# File 'lib/bunto-compose/file_creator.rb', line 4

def force
  @force
end

Instance Method Details

#create!Object



10
11
12
13
14
# File 'lib/bunto-compose/file_creator.rb', line 10

def create!
  validate_should_write!
  ensure_directory_exists
  write_file
end