Class: Jekyll::Compose::FileCreator

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fileInfo, force = false, root = nil) ⇒ FileCreator

Returns a new instance of FileCreator.



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

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

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



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

def file
  @file
end

#forceObject (readonly)

Returns the value of attribute force.



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

def force
  @force
end

#rootObject (readonly)

Returns the value of attribute root.



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

def root
  @root
end

Instance Method Details

#create!Object



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

def create!
  validate_should_write!
  ensure_directory_exists
  write_file
end