Class: Doctrine::Context

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

Overview

public

Instance Method Summary collapse

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

#doctrineObject

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

#loadObject

public

23
24
25
# File 'lib/doctrine/context.rb', line 23

def load(...)
  self.class.new(suite: @suite).internal_load(...)
end