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.



105
106
107
# File 'lib/workflow.rb', line 105

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.



103
104
105
# File 'lib/workflow.rb', line 103

def action
  @action
end

#metaObject

Returns the value of attribute meta.



103
104
105
# File 'lib/workflow.rb', line 103

def meta
  @meta
end

#nameObject

Returns the value of attribute name.



103
104
105
# File 'lib/workflow.rb', line 103

def name
  @name
end

#transitions_toObject

Returns the value of attribute transitions_to.



103
104
105
# File 'lib/workflow.rb', line 103

def transitions_to
  @transitions_to
end

Instance Method Details

#perform_validation?Boolean

Returns:

  • (Boolean)


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

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

#to_sObject



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

def to_s
  @name.to_s
end

#to_symObject



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

def to_sym
  @name.to_sym
end