Module: Card::Set::Event::SkipAndTrigger

Included in:
All
Defined in:
card/lib/card/set/event/skip_and_trigger.rb

Overview

opt into (trigger) or out of (skip) events

Instance Method Summary collapse

Instance Method Details

#skip_event!(*events) ⇒ Object

force skipping this event for all cards in act



7
8
9
10
# File 'card/lib/card/set/event/skip_and_trigger.rb', line 7

def skip_event! *events
  @full_skip_hash = nil
  force_events events, act_skip_hash
end

#skip_event_in_action!(*events) ⇒ Object

force skipping this event for this card only



13
14
15
# File 'card/lib/card/set/event/skip_and_trigger.rb', line 13

def skip_event_in_action! *events
  force_events events, full_skip_hash
end

#skip_hashObject

hash form of raw skip setting, eg { “my_event” => true }



29
30
31
# File 'card/lib/card/set/event/skip_and_trigger.rb', line 29

def skip_hash
  @skip_hash ||= hash_with_value skip, true
end

#trigger_event!(*events) ⇒ Object

force triggering this event (when it comes up) for all cards in act



18
19
20
21
# File 'card/lib/card/set/event/skip_and_trigger.rb', line 18

def trigger_event! *events
  @full_trigger_hash = nil
  force_events events, act_trigger_hash
end

#trigger_event_in_action!(*events) ⇒ Object

force triggering this event (when it comes up) for this card only



24
25
26
# File 'card/lib/card/set/event/skip_and_trigger.rb', line 24

def trigger_event_in_action! *events
  force_events events, full_trigger_hash
end

#trigger_hashObject



33
34
35
# File 'card/lib/card/set/event/skip_and_trigger.rb', line 33

def trigger_hash
  @trigger_hash ||= hash_with_value trigger, true
end