Class: Workflow::Specification

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta = {}, &specification) ⇒ Specification

Returns a new instance of Specification.



11
12
13
14
15
# File 'lib/workflow/specification.rb', line 11

def initialize(meta = {}, &specification)
  @states = Hash.new
  @meta = meta
  instance_eval(&specification)
end

Instance Attribute Details

#after_transition_procObject

Returns the value of attribute after_transition_proc.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def after_transition_proc
  @after_transition_proc
end

#before_transition_procObject

Returns the value of attribute before_transition_proc.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def before_transition_proc
  @before_transition_proc
end

#initial_stateObject

Returns the value of attribute initial_state.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def initial_state
  @initial_state
end

#metaObject

Returns the value of attribute meta.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def meta
  @meta
end

#on_error_procObject

Returns the value of attribute on_error_proc.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def on_error_proc
  @on_error_proc
end

#on_transition_procObject

Returns the value of attribute on_transition_proc.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def on_transition_proc
  @on_transition_proc
end

#statesObject

Returns the value of attribute states.



8
9
10
# File 'lib/workflow/specification.rb', line 8

def states
  @states
end

Instance Method Details

#state_namesObject



17
18
19
# File 'lib/workflow/specification.rb', line 17

def state_names
  states.keys
end