Sha256: c684ff4337cc6325cd10c1885090e2324acc23a3bdec6b52679dad04e2518e2c

Contents?: true

Size: 395 Bytes

Versions: 5

Compression:

Stored size: 395 Bytes

Contents

module StateShifter
  class Event
    attr_reader :name, :from, :to, :guards, :callback

    def initialize from, name, to=nil, guards=nil, callback=nil
      @name = name
      @from = from
      @to = to
      @guards = [guards].flatten.compact
      @callback = callback
    end

    def has_guards?
      !@guards.nil?
    end

    def has_callback?
      !@callback.nil?
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
state_shifter-0.8.1 lib/state_shifter/event.rb
state_shifter-0.8.0 lib/state_shifter/event.rb
state_shifter-0.7.2 lib/state_shifter/event.rb
state_shifter-0.7.1 lib/state_shifter/event.rb
state_shifter-0.7.0 lib/state_shifter/event.rb