Class: Core::Loader::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/core/loader/context.rb

Overview

public

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path:, root:, type:, target:, strict:) ⇒ Context

Returns a new instance of Context.



18
19
20
21
22
23
24
25
# File 'lib/core/loader/context.rb', line 18

def initialize(path:, root:, type:, target:, strict:)
  @path = Pathname(path)
  @root = Pathname(root)
  @type = type.to_sym
  @target = target
  @strict = strict
  prepare_to_load!
end

Class Method Details

.load(path:, root:, type:, target:, strict:) ⇒ Object



13
14
15
# File 'lib/core/loader/context.rb', line 13

def load(path:, root:, type:, target:, strict:)
  new(path: path, root: root, type: type, target: target, strict: strict).load
end

Instance Method Details

#loadObject

public


29
30
31
# File 'lib/core/loader/context.rb', line 29

def load
  eval(@path.read, binding, @path.to_s)
end