Class: Campa::Core::Load

Inherits:
Object
  • Object
show all
Defined in:
lib/campa/core/load.rb

Instance Method Summary collapse

Constructor Details

#initializeLoad

Returns a new instance of Load.



4
5
6
# File 'lib/campa/core/load.rb', line 4

def initialize
  @evaler = Evaler.new
end

Instance Method Details

#call(*paths, env:) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/campa/core/load.rb', line 8

def call(*paths, env:)
  verify_presence(paths)
  paths.reduce(nil) do |_, file|
    reader = Reader.new(File.expand_path(file))
    evaler.eval(reader, env)
  end
end