Sha256: 6b3e77febabf090346fd8a7c2e63d212ef145289fb1ca8009d95bde0ca030e05

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

module Workflow
  class Event

    attr_accessor :name, :transitions_to, :meta, :action

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

    def draw(graph, from_state)
      graph.add_edges(from_state.name.to_s, transitions_to.to_s, meta.merge(:label => to_s))
    end

    def to_s
      @name.to_s
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
workflow-1.1.0 lib/workflow/event.rb
workflow-rails4-1.1.0 lib/workflow/event.rb