class Stately::State::StateConfigurator

Attributes

after_transitions[R]
allow_from_states[R]
before_transitions[R]
prevent_from_states[R]
validations[R]

Public Class Methods

new(&block) click to toggle source
# File lib/stately/state.rb, line 66
def initialize(&block)
  instance_eval(&block)
end

Public Instance Methods

after_transition(options={}) click to toggle source
# File lib/stately/state.rb, line 80
def after_transition(options={})
  @after_transitions ||= []
  @after_transitions << options
end
allow_from(*states) click to toggle source
# File lib/stately/state.rb, line 70
def allow_from(*states)
  @allow_from_states ||= []
  @allow_from_states |= states.map(&:to_sym)
end
before_transition(options={}) click to toggle source
# File lib/stately/state.rb, line 75
def before_transition(options={})
  @before_transitions ||= []
  @before_transitions << options
end
prevent_from(*states) click to toggle source
# File lib/stately/state.rb, line 85
def prevent_from(*states)
  @prevent_from_states ||= []
  @prevent_from_states |= states.map(&:to_sym)
end
validate(options={}) click to toggle source
# File lib/stately/state.rb, line 90
def validate(options={})
  @validations ||= []
  @validations << options
end