module Ably::Modules::EventEmitter::ClassMethods
Attributes
Public Instance Methods
Source
# File lib/ably/modules/event_emitter.rb, line 36 def configure_event_emitter(options = {}) @event_emitter_coerce_proc = options[:coerce_into] end
Configure included EventEmitter
@param [Hash] options the options for the {EventEmitter} @option options [Proc] :coerce_into A lambda/Proc that is used to coerce the event names for all events. This is useful to ensure the event names conform to a naming or type convention.
@example
configure_event_emitter coerce_into: lambda { |event| event.to_sym }
Source
# 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
Ensure @event_emitter_coerce_proc option is passed down to any classes that inherit the class with callbacks
Calls superclass method