Class: Vercon::Factories

Inherits:
Object
  • Object
show all
Defined in:
lib/vercon/factories.rb

Constant Summary collapse

PATH =
"./spec/factories"

Instance Method Summary collapse

Constructor Details

#initializeFactories

Returns a new instance of Factories.



10
11
12
# File 'lib/vercon/factories.rb', line 10

def initialize
  @files = Dry::Files.new
end

Instance Method Details

#loadObject



14
15
16
17
18
19
20
# File 'lib/vercon/factories.rb', line 14

def load
  return unless @files.directory?(PATH)

  Dir[@files.expand_path(@files.join(PATH, "**", "*.rb"))].map do |file_path|
    load_factory(file_path)
  end.flatten.compact
end