Class: PlatinaWorld::Generators::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/platina_world/generators/base.rb

Direct Known Subclasses

File, Mock

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ Base

Returns a new instance of Base.



4
5
6
# File 'lib/platina_world/generators/base.rb', line 4

def initialize(paths)
  @paths = paths
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/platina_world/generators/base.rb', line 8

def call
  @paths.each do |path|
    file_path = path.file_path

    if file_exist?(file_path)
      PlatinaWorld::FileStatus.skip(file_path)
    else
      generate(path)
      PlatinaWorld::FileStatus.create(file_path)
    end
  end
end