Class: Card::Set::Event
- Inherits:
-
Object
- Object
- Card::Set::Event
- Includes:
- Callbacks, DelayedEvent, Options
- Defined in:
- lib/card/set/event.rb,
lib/card/set/event/all.rb,
lib/card/set/event/options.rb,
lib/card/set/event/callbacks.rb,
lib/card/set/event/delayed_event.rb,
lib/card/set/event/skip_and_trigger.rb
Overview
Supports the definition of events via the Events API
Defined Under Namespace
Modules: All, Api, Callbacks, DelayedEvent, Options, SkipAndTrigger
Constant Summary collapse
Constants included from DelayedEvent
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#set_module ⇒ Object
readonly
Returns the value of attribute set_module.
Instance Method Summary collapse
- #block ⇒ Object
- #define ⇒ Object
-
#delaying_method_name ⇒ Object
the name for the method that adds the event to the delayed job queue.
-
#initialize(event, set_module) ⇒ Event
constructor
A new instance of Event.
-
#name ⇒ Object
The name of the event.
- #register(stage_or_opts, opts, &final) ⇒ Object
-
#simple_method_name ⇒ Object
the name for the method that only executes the code defined in the event.
Methods included from Callbacks
#set_event_callback, #set_event_callbacks, #valid_event_callback
Methods included from Options
#callback_name, #event_opts, #invalid_condition_values, #normalize_opts, #process_action_opts, #process_stage_opts, #validate_condition_name, #validate_condition_value, #validate_conditions, #validate_standard_condition_value, #validate_when_value
Methods included from DelayedEvent
Constructor Details
#initialize(event, set_module) ⇒ Event
Returns a new instance of Event.
85 86 87 88 |
# File 'lib/card/set/event.rb', line 85 def initialize event, set_module @event = event @set_module = set_module end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
83 84 85 |
# File 'lib/card/set/event.rb', line 83 def opts @opts end |
#set_module ⇒ Object (readonly)
Returns the value of attribute set_module.
83 84 85 |
# File 'lib/card/set/event.rb', line 83 def set_module @set_module end |
Instance Method Details
#block ⇒ Object
108 109 110 |
# File 'lib/card/set/event.rb', line 108 def block @event_block end |
#define ⇒ Object
97 98 99 100 101 |
# File 'lib/card/set/event.rb', line 97 def define Card.define_callbacks @event define_event set_event_callbacks end |
#delaying_method_name ⇒ Object
the name for the method that adds the event to the delayed job queue
120 121 122 |
# File 'lib/card/set/event.rb', line 120 def "#{@event}_with_delay" end |
#name ⇒ Object
Returns the name of the event.
104 105 106 |
# File 'lib/card/set/event.rb', line 104 def name @event end |
#register(stage_or_opts, opts, &final) ⇒ Object
90 91 92 93 94 95 |
# File 'lib/card/set/event.rb', line 90 def register stage_or_opts, opts, &final @opts = event_opts stage_or_opts, opts @event_block = final validate_conditions define end |
#simple_method_name ⇒ Object
the name for the method that only executes the code defined in the event
114 115 116 |
# File 'lib/card/set/event.rb', line 114 def simple_method_name "#{@event}_without_callbacks" end |