Module: Card::Set::Event

Included in:
Card::Set
Defined in:
lib/card/set/event.rb

Overview

Implements the event API for card sets

Instance Method Summary collapse

Instance Method Details

#event(event, stage_or_opts = {}, opts = {}, &final) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/card/set/event.rb', line 42

def event event, stage_or_opts={}, opts={}, &final
  if stage_or_opts.is_a? Symbol
    opts[:in] = stage_or_opts
  else
    opts = stage_or_opts
  end
  process_stage_opts opts

  Card.define_callbacks event
  define_event event, opts, &final
  set_event_callbacks event, opts
end