Class: RailsWorkflow::OperationDecorator

Inherits:
OperationHelperDecorator show all
Defined in:
app/decorators/rails_workflow/operation_decorator.rb

Instance Method Summary collapse

Methods inherited from OperationHelperDecorator

#assigned_to, #assignment_by_group, #assignment_by_role, #completed_at, #created_at

Methods inherited from Decorator

collection_decorator_class

Instance Method Details

#asyncObject



17
18
19
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 17

def async
  object.async ? 'Yes' : 'No'
end

#child_processObject



25
26
27
28
29
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 25

def child_process
  if object.child_process
    ::RailsWorkflow::ProcessDecorator.decorate(object.child_process)
  end
end

#contextObject



9
10
11
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 9

def context
  ContextDecorator.decorate object.context
end

#is_backgroundObject



21
22
23
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 21

def is_background
  object.is_background ? 'Yes' : 'No'
end

#processObject



13
14
15
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 13

def process
  object.process.decorate
end

#show_dependenciesObject



31
32
33
34
35
36
37
38
39
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 31

def show_dependencies
  if object.dependencies.present?
    object.dependencies.map do |dependency|
      Operation.find(dependency['operation_id']).decorate
    end
  else
    []
  end
end

#show_template_dependenciesObject



41
42
43
# File 'app/decorators/rails_workflow/operation_decorator.rb', line 41

def show_template_dependencies
  template.show_dependencies
end