Class: Doctrine::Context
- Inherits:
-
Object
- Object
- Doctrine::Context
- Defined in:
- lib/doctrine/context.rb
Overview
- public
Instance Method Summary collapse
-
#doctrine ⇒ Object
[public].
-
#initialize(suite:) ⇒ Context
constructor
A new instance of Context.
- #internal_load(path:, root:, type:, target:, strict:) ⇒ Object
-
#load ⇒ Object
[public].
Constructor Details
#initialize(suite:) ⇒ Context
Returns a new instance of Context.
9 10 11 |
# File 'lib/doctrine/context.rb', line 9 def initialize(suite:) @suite = suite end |
Instance Method Details
#doctrine ⇒ Object
- public
15 16 17 18 19 |
# File 'lib/doctrine/context.rb', line 15 def doctrine(...) @context.doctrine(...).tap { |doctrine| @suite.doctrines << doctrine } end |
#internal_load(path:, root:, type:, target:, strict:) ⇒ Object
27 28 29 30 31 |
# File 'lib/doctrine/context.rb', line 27 def internal_load(path:, root:, type:, target:, strict:) @context = Core::Loader::Context.new(path: path, root: root, type: type, target: target, strict: strict) eval(path.read, binding, path.to_s) end |
#load ⇒ Object
- public
23 24 25 |
# File 'lib/doctrine/context.rb', line 23 def load(...) self.class.new(suite: @suite).internal_load(...) end |