Class: WithEvents::Event
- Inherits:
-
Object
- Object
- WithEvents::Event
- Defined in:
- lib/with_events/event.rb
Instance Attribute Summary collapse
-
#callback ⇒ Object
readonly
Returns the value of attribute callback.
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#finder ⇒ Object
readonly
Returns the value of attribute finder.
-
#identifier ⇒ Object
readonly
Returns the value of attribute identifier.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(name, klass, options = {}) ⇒ Event
constructor
Options:.
Constructor Details
#initialize(name, klass, options = {}) ⇒ Event
Options:
name - event name klass - resource class name options[:condition] - condition to check whether event can be triggered options[:callback] - callback to invoke on event options[:stream] - stream object event belongs to options[:identifier] - resource identifier (symbol, Proc or Class) options[:finder] - resource finder (symbol, Proc or Class) options[:subscribe] - subscribe to SQS queue
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/with_events/event.rb', line 19 def initialize(name, klass, = {}) @name = name @klass = klass = @condition = [:condition] @callback = [:callback] @stream = [:stream] @identifier = [:identifier] @finder = [:finder] define_condition define_callback end |
Instance Attribute Details
#callback ⇒ Object (readonly)
Returns the value of attribute callback.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def callback @callback end |
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def condition @condition end |
#finder ⇒ Object (readonly)
Returns the value of attribute finder.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def finder @finder end |
#identifier ⇒ Object (readonly)
Returns the value of attribute identifier.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def identifier @identifier end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
5 6 7 |
# File 'lib/with_events/event.rb', line 5 def stream @stream end |