Class: Bcome::Orchestration::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/objects/orchestration/base.rb

Direct Known Subclasses

InteractiveTerraform

Instance Method Summary collapse

Constructor Details

#initialize(node, arguments) ⇒ Base

Returns a new instance of Base.



5
6
7
8
# File 'lib/objects/orchestration/base.rb', line 5

def initialize(node, arguments)
  @node = node
  @arguments = arguments
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *_arguments) ⇒ Object

Raises:

  • (NameError)


22
23
24
25
26
27
# File 'lib/objects/orchestration/base.rb', line 22

def method_missing(method_sym, *_arguments)
  ## A thread error deep in the bowels of IRB is not playing well with orchestration missing methods within the orchestration namespace. Until this can be resolved,
  ## I've re-implemented it here.

  raise NameError, "NameError (undefined local variable or method '#{method_sym}' for #{self.class}"
end

Instance Method Details

#do_executeObject



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/objects/orchestration/base.rb', line 10

def do_execute
  raise Bcome::Exception::MissingExecuteOnRegistryObject, self.class.to_s unless respond_to?(:execute)

  begin
    execute
  rescue ::Bcome::Exception::Base => bcome_exception
    show_backtrace = true unless bcome_exception.is_a?(::Bcome::Exception::InvalidMetaDataEncryptionKey)
    bcome_exception.pretty_display(show_backtrace)
    raise ::Bcome::Exception::UserOrchestrationError, self.class.to_s
  end
end