Module: Card::Set::Event::All

Includes:
SkipAndTrigger
Included in:
Card
Defined in:
card/lib/card/set/event/all.rb

Overview

card methods for testing event applicability

Instance Method Summary collapse

Methods included from SkipAndTrigger

#skip_event!, #skip_event_in_action!, #skip_hash, #trigger_event!, #trigger_event_in_action!, #trigger_hash

Instance Method Details

#event_applies?(event) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
# File 'card/lib/card/set/event/all.rb', line 8

def event_applies? event
  return unless set_condition_applies? event.set_module, event.opts[:changing]

  CONDITIONS.all? { |c| send "#{c}_condition_applies?", event, event.opts[c] }
end