Module: Stateful::InstanceMethods

Defined in:
lib/Stateful/InstanceMethods.rb

Instance Method Summary collapse

Instance Method Details

#active?Boolean

predicate methods

Returns:

  • (Boolean)


25
26
27
# File 'lib/Stateful/InstanceMethods.rb', line 25

def active?
  !final_state?
end

#all_statesObject



7
8
9
# File 'lib/Stateful/InstanceMethods.rb', line 7

def all_states
  self.class.stateful_states
end

#final_stateObject



15
16
17
# File 'lib/Stateful/InstanceMethods.rb', line 15

def final_state
  self.class.final_state
end

#final_statesObject



19
20
21
# File 'lib/Stateful/InstanceMethods.rb', line 19

def final_states
  self.class.final_states
end

#initial_stateObject



11
12
13
# File 'lib/Stateful/InstanceMethods.rb', line 11

def initial_state
  self.class.initial_state
end