Class: Doctrine::Run

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

Overview

public

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(doctrine:, tenet:) ⇒ Run

Returns a new instance of Run.


7
8
9
10
11
# File 'lib/doctrine/run.rb', line 7

def initialize(doctrine:, tenet:)
  @doctrine = doctrine
  @tenet = tenet
  @error = nil
end

Instance Attribute Details

#errorObject (readonly)

public

15
16
17
# File 'lib/doctrine/run.rb', line 15

def error
  @error
end

Instance Method Details

#errored(error) ⇒ Object

public

33
34
35
# File 'lib/doctrine/run.rb', line 33

def errored(error)
  @error = error
end

#errored?Boolean

public

Returns:

  • (Boolean)

27
28
29
# File 'lib/doctrine/run.rb', line 27

def errored?
  !@error.nil?
end

#performObject

public

19
20
21
22
23
# File 'lib/doctrine/run.rb', line 19

def perform
  @doctrine.new.instance_eval(&@tenet.block)
rescue => error
  errored(error)
end