Module: Workflow::ClassMethods

Defined in:
lib/workflow.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#workflow_specObject (readonly)

Returns the value of attribute workflow_spec.



10
11
12
# File 'lib/workflow.rb', line 10

def workflow_spec
  @workflow_spec
end

Instance Method Details

#workflow(column = nil, &specification) ⇒ Object



22
23
24
25
26
27
# File 'lib/workflow.rb', line 22

def workflow(column=nil,&specification)
  column = workflow_column(column)
  assign_workflow Specification.new(Hash.new, &specification)

  inject_setter_for_state
end

#workflow_column(column_name = nil) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/workflow.rb', line 12

def workflow_column(column_name=nil)
  #I guess we want to preserve the api???
  @workflow_state_column_name ||= column_name
  if @workflow_state_column_name.nil? && superclass.respond_to?(:workflow_column)
    @workflow_state_column_name = superclass.workflow_column
  end
  @workflow_state_column_name ||= :workflow_state

end