Class: Hobo::Model::Lifecycles::State

Inherits:
Struct
  • Object
show all
Includes:
Actions
Defined in:
lib/hobo/model/lifecycles/state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Actions

#acting_user_is?, #apply_user_becomes!, #available_to, #available_to_acting_user?, #can_run?, #fire_event, #get_state, #guard_ok?, #prepare!, #publishable?, #publishable_by, #routable_for?, #run_hook

Constructor Details

#initialize(*args) ⇒ State

Returns a new instance of State.



9
10
11
12
# File 'lib/hobo/model/lifecycles/state.rb', line 9

def initialize(*args)
  super
  self.transitions_out = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



5
6
7
# File 'lib/hobo/model/lifecycles/state.rb', line 5

def name
  @name
end

#on_enterObject

Returns the value of attribute on_enter

Returns:

  • (Object)

    the current value of on_enter



5
6
7
# File 'lib/hobo/model/lifecycles/state.rb', line 5

def on_enter
  @on_enter
end

#transitions_outObject

Returns the value of attribute transitions_out

Returns:

  • (Object)

    the current value of transitions_out



5
6
7
# File 'lib/hobo/model/lifecycles/state.rb', line 5

def transitions_out
  @transitions_out
end

Instance Method Details

#activate!(record) ⇒ Object



15
16
17
# File 'lib/hobo/model/lifecycles/state.rb', line 15

def activate!(record)
  fire_event(record, on_enter)
end