You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
state_machine :state, initial: :ordinary_world do
event :handle_event do
transition any => same
end
event :receive_call do
transition ordinary_world: :adventure
end
event :begin_journey do
transition adventure: :crossing_threshold
end
event :thrown_into_world do
transition crossing_threshold: :tests_allies_enemies
end
event :join_team do
transition tests_allies_enemies: :approach
end
event :meet_mentor do
transition any => same
end
event :cross_threshold do
transition tests_allies_enemies: :approach
end
event :observe do
transition any => same
end
event :descend do
transition approach: :ordeal
end
event :raise_to_apotheosis do
transition ordeal: :reward
end
event :decide do
transition any => same
end
event :act do
transition any => same
end
event :judge do
transition any => same
end
event :critique do
transition any => same
end
event :struggle do
transition any => same
end
event :transform do
transition ordeal: :reward
end
event :take_sword do
transition reward: :road_back
end
event :gain_wisdom do
transition any => same
end
event :refuse_call do
transition adventure: :ordinary_world
end
event :succeed do
transition road_back: :resurrection
end
event :return_home do
transition resurrection: :return_with_elixir
end
event :resurrect do
transition any => :resurrection
end
def resurrection(failure)
# Implementation
end
end
Other necessary models...
class World < ApplicationRecord; end
class Event < ApplicationRecord; end
class Challenge < ApplicationRecord; end
class Mentor < ApplicationRecord; end
class Sword < ApplicationRecord; end
class Home < ApplicationRecord; end
The text was updated successfully, but these errors were encountered:
class HerosJourney < ApplicationRecord
belongs_to :hero
belongs_to :world
has_many :events
has_many :challenges
has_one :mentor
has_one :sword
has_one :home
state_machine :state, initial: :ordinary_world do
event :handle_event do
transition any => same
end
end
def recognize(recognition)
# Implementation
end
def observe(observation)
# Implementation
end
Other methods...
end
class Hero < ApplicationRecord
has_one :heros_journey
has_many :challenges
has_one :sword
has_one :home
def struggle(challenge)
# Implementation
end
def transform(challenge)
# Implementation
end
def take(sword)
# Implementation
end
def gain(wisdom)
# Implementation
end
def refusal(call)
# Implementation
end
def succeed(sword)
# Implementation
end
def return_to(home)
# Implementation
end
def resurrection(failure)
# Implementation
end
end
Other necessary models...
class World < ApplicationRecord; end
class Event < ApplicationRecord; end
class Challenge < ApplicationRecord; end
class Mentor < ApplicationRecord; end
class Sword < ApplicationRecord; end
class Home < ApplicationRecord; end
The text was updated successfully, but these errors were encountered: