Class: Sipity::WorkflowAction

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/sipity/workflow_action.rb

Overview

A named thing that happens within the bounds of a :workflow.

When a Sipity::WorkflowAction is taken, it may:

  • Advance the state to a new Sipity::WorkflowState (as defined by the :resulting_workflow_state relation)

  • Deliver one or more notifications (as defined by the :notifiable_contexts relation)

Class Method Summary collapse

Class Method Details

.name_for(input, &block) ⇒ String

Parameters:

  • input (Object)

Returns:

  • (String)

41
42
43
44
45
46
47
48
49
# File 'app/models/sipity/workflow_action.rb', line 41

def self.name_for(input, &block)
  result = case input
           when String, Symbol
             input.to_s.sub(/[\?\!]\Z/, '')
           when Sipity::WorkflowAction
             input.name
           end
  Sipity.handle_conversion(input, result, :to_sipity_action_name, &block)
end