Module: Ably::Modules::EventEmitter::ClassMethods
- Defined in:
- lib/ably/modules/event_emitter.rb
Instance Attribute Summary collapse
-
#event_emitter_coerce_proc ⇒ Object
readonly
Returns the value of attribute event_emitter_coerce_proc.
Instance Method Summary collapse
-
#configure_event_emitter(options = {}) ⇒ Object
Configure included EventEmitter.
-
#inherited(subclass) ⇒ Object
Ensure @event_emitter_coerce_proc option is passed down to any classes that inherit the class with callbacks.
Instance Attribute Details
#event_emitter_coerce_proc ⇒ Object (readonly)
Returns the value of attribute event_emitter_coerce_proc.
26 27 28 |
# File 'lib/ably/modules/event_emitter.rb', line 26 def event_emitter_coerce_proc @event_emitter_coerce_proc end |
Instance Method Details
#configure_event_emitter(options = {}) ⇒ Object
Configure included EventEmitter
36 37 38 |
# File 'lib/ably/modules/event_emitter.rb', line 36 def configure_event_emitter( = {}) @event_emitter_coerce_proc = [:coerce_into] end |
#inherited(subclass) ⇒ Object
Ensure @event_emitter_coerce_proc option is passed down to any classes that inherit the class with callbacks
41 42 43 44 |
# File 'lib/ably/modules/event_emitter.rb', line 41 def inherited(subclass) subclass.instance_variable_set('@event_emitter_coerce_proc', @event_emitter_coerce_proc) if defined?(@event_emitter_coerce_proc) super end |