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

Inherits:
ApplicationJob show all
Defined in:
card/lib/card/set/event/delayed_event.rb

Instance Method Summary collapse

Instance Method Details

#handle_performObject



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

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

#load_card(card, card_attribs) ⇒ Object



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

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



51
52
53
54
55
56
57
58
# File 'card/lib/card/set/event/delayed_event.rb', line 51

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