Class: Bricolage::JobNet::FileLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/bricolage/jobnet.rb

Instance Method Summary collapse

Constructor Details

#initialize(ctx) ⇒ FileLoader

Returns a new instance of FileLoader.



283
284
285
# File 'lib/bricolage/jobnet.rb', line 283

def initialize(ctx)
  @context = ctx
end

Instance Method Details

#load(ref) ⇒ Object

Raises:



287
288
289
290
291
# File 'lib/bricolage/jobnet.rb', line 287

def load(ref)
  path = @context.root_relative_path(ref.relative_path)
  raise ParameterError, "undefined subnet: #{ref}" unless path.file?
  JobNet.load(path, ref)
end