Class: Nayati::Operation

Inherits:
ApplicationRecord show all
Includes:
NameBasedConstantable
Defined in:
app/models/nayati/operation.rb

Instance Method Summary collapse

Methods included from NameBasedConstantable

#camelcased_name, name_as_constant, name_as_namespace, #namespaced_name, #underscored_name, underscored_name

Instance Method Details

#build_implementer(operation_context, result_object) ⇒ Object



17
18
19
# File 'app/models/nayati/operation.rb', line 17

def build_implementer(operation_context, result_object)
  operation_implementer_klass_name.constantize.new(operation_context, result_object)
end

#details_hashObject



21
22
23
# File 'app/models/nayati/operation.rb', line 21

def details_hash
  { name: self.name, after_success_operation: after_success_operation.try(:name), after_failure_operation: after_failure_operation.try(:name)}
end

#format_nameObject



25
26
27
# File 'app/models/nayati/operation.rb', line 25

def format_name
  self.name = namespaced_name
end

#operation_implementer_klass_nameObject



13
14
15
# File 'app/models/nayati/operation.rb', line 13

def operation_implementer_klass_name
  "#{workflow.camelcased_name}NayatiWorkflow::#{self.camelcased_name}NayatiOperation"
end