Class: Card::Set::Event::DelayedEvent::IntegrateWithDelayJob

Inherits:
Cardio::Job
  • Object
show all
Defined in:
lib/card/set/event/delayed_event.rb

Instance Method Summary collapse

Instance Method Details

#handle_performObject



67
68
69
70
71
72
73
74
# File 'lib/card/set/event/delayed_event.rb', line 67

def handle_perform
  yield
rescue StandardError => e
  Card::Error.report e, @card
  raise e
ensure
  Director.expire
end

#load_card(card, card_attribs) ⇒ Object



76
77
78
79
80
# File 'lib/card/set/event/delayed_event.rb', line 76

def load_card card, card_attribs
  @card = card
  Card::Cache.renew
  card.deserialize_for_active_job! card_attribs
end

#perform(act_id, card, card_attribs, env, auth, method_name) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/card/set/event/delayed_event.rb', line 58

def perform act_id, card, card_attribs, env, auth, method_name
  handle_perform do
    load_card card, card_attribs
    Director.contextualize_delayed_event act_id, card, env, auth do
      card.send method_name
    end
  end
end