Class: Core::Loader::Context
- Inherits:
-
Object
- Object
- Core::Loader::Context
- Defined in:
- lib/core/loader/context.rb
Overview
- public
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(path:, root:, type:, target:, strict:) ⇒ Context
constructor
A new instance of Context.
-
#load ⇒ Object
[public].
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
#load ⇒ Object
- public
29 30 31 |
# File 'lib/core/loader/context.rb', line 29 def load eval(@path.read, binding, @path.to_s) end |