Class: Workflow::Event

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, transitions_to, meta = {}, &action) ⇒ Event

Returns a new instance of Event.



110
111
112
# File 'lib/workflow.rb', line 110

def initialize(name, transitions_to, meta = {}, &action)
  @name, @transitions_to, @meta, @action = name, transitions_to.to_sym, meta, action
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



108
109
110
# File 'lib/workflow.rb', line 108

def action
  @action
end

#metaObject

Returns the value of attribute meta.



108
109
110
# File 'lib/workflow.rb', line 108

def meta
  @meta
end

#nameObject

Returns the value of attribute name.



108
109
110
# File 'lib/workflow.rb', line 108

def name
  @name
end

#transitions_toObject

Returns the value of attribute transitions_to.



108
109
110
# File 'lib/workflow.rb', line 108

def transitions_to
  @transitions_to
end

Instance Method Details

#perform_validation?Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/workflow.rb', line 114

def perform_validation?
  !self.meta[:skip_all_validations]
end

#to_sObject



122
123
124
# File 'lib/workflow.rb', line 122

def to_s
  @name.to_s
end

#to_symObject



118
119
120
# File 'lib/workflow.rb', line 118

def to_sym
  @name.to_sym
end